0
votes

I'm attempting to write documentation for how to use a custom Liquid tag, yet I cannot figure out how to display the examples, since Liquid keeps wanting to render those tags (even if I put the example code inside code blocks).

The following tag gets executed, instead of treating it as code:

```
{% flink http://www.youtube.com/watch?v=Bt9zSfinwFA "Vertical Video Syndrome - A PSA" %}
```

BB has a [noparse] tag; is there any equivalent way of saying "Do not parse any tags between these two lines" in Liquid?

2

2 Answers

3
votes

What you're looking for is the raw tag:

```
{% raw %}
  {% flink http://www.youtube.com/watch?v=Bt9zSfinwFA "Vertical Video Syndrome - A PSA" %}
{% endraw %}
```
0
votes

The documentation for Octopress does something clever in this case.

Whenever they want to display something without rendering it, they wrap it in {{ "<content>" }}, which tells Liquid "Treat the <content> area as a string, and just print it out as-is (which means it gets passed over by the parser searching for tags).

You could wrap the entire line in one of those, but it's enough just to wrap the "begin tag" character {%, like this:

```
{{ "{%" }} flink http://www.youtube.com/watch?v=Bt9zSfinwFA "Vertical Video Syndrome - A PSA" %}
```

The the closing of the tag, %}, doesn't actually need to be escaped, since the parser will ignore any closing tags unless there is an open tag that still "needs a partner".