From 2f703b30dbd3c67e8db04ba6df7c9e36b411d2c4 Mon Sep 17 00:00:00 2001 From: Brian Jones Date: Wed, 29 Mar 2017 23:01:40 -0400 Subject: [PATCH 1/4] 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. +``` From 4bd5446a4e85872668ec7eeba78cc4448d23f574 Mon Sep 17 00:00:00 2001 From: Brian Jones Date: Thu, 30 Mar 2017 09:58:10 -0400 Subject: [PATCH 2/4] Fix raw tag and correct output --- tags/raw.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tags/raw.md b/tags/raw.md index b08a0fe..49ba629 100644 --- a/tags/raw.md +++ b/tags/raw.md @@ -7,16 +7,16 @@ 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 %} -``` +
+{% 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. +```text +{% raw %}In Handlebars, {{ this }} will be HTML-escaped, but {{{ that }}} will not.{% endraw %} ``` From cee4a2d7aeee98aad88ed9576c4d15f891d0d002 Mon Sep 17 00:00:00 2001 From: Brian Jones Date: Thu, 30 Mar 2017 10:11:04 -0400 Subject: [PATCH 3/4] Change title and filename to singular --- tags/{comments.md => comment.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename tags/{comments.md => comment.md} (97%) diff --git a/tags/comments.md b/tags/comment.md similarity index 97% rename from tags/comments.md rename to tags/comment.md index 64e231d..31392cf 100644 --- a/tags/comments.md +++ b/tags/comment.md @@ -1,5 +1,5 @@ --- -title: Comments +title: Comment description: An overview of comments tags in the Liquid template language. --- From 8b6f4d2a4507ec15f2db9486a9d64c93b8cc67f4 Mon Sep 17 00:00:00 2001 From: Brian Jones Date: Thu, 30 Mar 2017 10:12:18 -0400 Subject: [PATCH 4/4] Change Any Contents to Anything --- tags/comment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tags/comment.md b/tags/comment.md index 31392cf..d9d43fc 100644 --- a/tags/comment.md +++ b/tags/comment.md @@ -10,13 +10,13 @@ within will not be executed.

Input

```liquid {% raw %} -Any contents that you put between {% comment %} and {% endcomment %} tags +Anything 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 +Anything you put between {% comment %} and {% endcomment %} tags is turned into a comment. ```