From 2f703b30dbd3c67e8db04ba6df7c9e36b411d2c4 Mon Sep 17 00:00:00 2001 From: Brian Jones Date: Wed, 29 Mar 2017 23:01:40 -0400 Subject: [PATCH] Document some of the undocumented features --- basics/introduction.md | 14 ++++++++++++++ tags/comments.md | 22 ++++++++++++++++++++++ tags/raw.md | 22 ++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 tags/comments.md create mode 100644 tags/raw.md diff --git a/basics/introduction.md b/basics/introduction.md index 6db1fec..79b1513 100644 --- a/basics/introduction.md +++ b/basics/introduction.md @@ -68,3 +68,17 @@ You can read more about each type of tag in their respective sections. ```text {{ "/my/fancy/url" | append: ".html" }} ``` + +Multiple filters can be used on one output. They are applied from left to right. + +

Input

+```liquid +{% raw %} +{{ "adam!" | capitalize | prepend: "Hello " }} +{% endraw %} +``` + +

Output

+```text +Hello Adam! +``` diff --git a/tags/comments.md b/tags/comments.md new file mode 100644 index 0000000..64e231d --- /dev/null +++ b/tags/comments.md @@ -0,0 +1,22 @@ +--- +title: Comments +description: An overview of comments tags in the Liquid template language. +--- + +Allows you to leave un-rendered code inside a Liquid template. Any text within +the opening and closing `comment` blocks will not be output, and any Liquid code +within will not be executed. + +

Input

+```liquid +{% raw %} +Any contents that you put between {% comment %} and {% endcomment %} tags +is turned into a comment. +{% endraw %} +``` + +

Output

+```liquid +Any contents that you put between {% comment %} and {% endcomment %} tags +is turned into a comment. +``` diff --git a/tags/raw.md b/tags/raw.md new file mode 100644 index 0000000..b08a0fe --- /dev/null +++ b/tags/raw.md @@ -0,0 +1,22 @@ +--- +title: Raw +description: An overview of raw tags in the Liquid template language. +--- + +Raw temporarily disables tag processing. This is useful for generating content +(eg, Mustache, Handlebars) which uses conflicting syntax. + +

Input

+```text +{% raw %} +{% raw %} + In Handlebars, {{ this }} will be HTML-escaped, but {{{ that }}} will not. +{% endraw % } +{% endraw %} +``` + +

Output

+```liquid +Any contents that you put between {% comment %} and {% endcomment %} tags +is turned into a comment. +```