Builtin Templating Helpers

GitBook provides a serie of builtin filters and blocks to help you write templates.

Filters

value|default(default, [boolean])If value is strictly undefined, return default, otherwise value. If boolean is true, any JavaScript falsy value will return default (false, "", etc)

arr|sort(reverse, caseSens, attr) Sort arr with JavaScript's arr.sort function. If reverse is true, result will be reversed. Sort is case-insensitive by default, but setting caseSens to true makes it case-sensitive. If attr is passed, will compare attr from each item.

Blocks

{% markdown %}Markdown string{% endmarkdown %} Render inline markdown

{% asciidoc %}AsciiDoc string{% endasciidoc %} Render inline asciidoc

Author: snowdreams1006
Url: https://snowdreams1006.github.io/gitbook-official/en/templating/builtin.html
Source: snowdreams1006's Gitbook
This article was originally published in「snowdreams1006's Gitbook」,Reproduced please indicate the source, thank you for cooperation!

https://snowdreams1006.github.io/snowdreams1006-wechat-open.png


results matching ""

    No results matching ""