Status: idealose draftdraftproposalfinal reviewstable

Liquid for blockchain content

Let's get a common way of engaging Liquid templating for dynamic content from the blockchain.

This document describes the protocol "B://iquid" (pronounced biquid). Please share inputs and comments.

Introduction

Templating is a common way of merging data with structure. The Liquid has a highly flexible syntax all the logic you can ask for so you can template your way out of any situation.

Description

The B://iquid protocol lets content creators use Liquid as a templating engine for blockchain data and is inspired by the B://emplate idea model D.

In the following, we will use main data object to refer to the data context in which a Liquid template engine will run.

Definition

If you provide content from the blockchain you are compatible with the B://iquid protocol if you:

All key texts are case insensitive.

Example:

The following content

{{liquid=B://}}
{{onStock=B://3534afc24bfb8395d9452b3a384235591b56065c674e602a277b52dd0638e0c2}}
<ul id="stuff">
  {% for product in onStock.products %}
    <li><b>{{ product.name }}</b> Only {{ product.price | price }}.
  {% endfor %}
</ul>

Will produce


<ul id="stuff">
    <li><b>Spoon</b> Only 2.99.
    <li><b>Knife</b> Only 4.5.
    <li><b>Fork</b> Only 5.15.
</ul>

Implementations

No known implementations.


Please share inputs and comments.