From 8c68415883541132ff33e58760e12353e3770a63 Mon Sep 17 00:00:00 2001 From: tbreuss Date: Sun, 25 Dec 2022 14:31:03 +0100 Subject: [PATCH] docs: add Twig's built-in tests, filters, functions and tags Signed-off-by: tbreuss --- website/site/data/twig_filters_builtin.yml | 55 +++++++++++++++++++ website/site/data/twig_functions_builtin.yml | 17 ++++++ website/site/data/twig_tags_builtin.yml | 21 +++++++ website/site/data/twig_tests_builtin.yml | 12 ++++ .../pages/2-doc/5-indepth/5-twig-filters.md | 13 ++++- .../pages/2-doc/5-indepth/6-twig-functions.md | 11 ++++ .../site/pages/2-doc/5-indepth/8-twig-tags.md | 15 +++++ .../pages/2-doc/5-indepth/8-twig-tests.md | 11 ++++ 8 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 website/site/data/twig_filters_builtin.yml create mode 100644 website/site/data/twig_functions_builtin.yml create mode 100644 website/site/data/twig_tags_builtin.yml create mode 100644 website/site/data/twig_tests_builtin.yml create mode 100644 website/site/pages/2-doc/5-indepth/8-twig-tags.md diff --git a/website/site/data/twig_filters_builtin.yml b/website/site/data/twig_filters_builtin.yml new file mode 100644 index 00000000..8902fae0 --- /dev/null +++ b/website/site/data/twig_filters_builtin.yml @@ -0,0 +1,55 @@ +--- +- name: abs +- name: batch +- name: capitalize +- name: column +- name: convert_encoding +- name: country_name +- name: currency_name +- name: currency_symbol +- name: data_uri +- name: date +- name: date_modify +- name: default +- name: escape +- name: filter +- name: first +- name: format +- name: format_currency +- name: format_date +- name: format_datetime +- name: format_number +- name: format_time +- name: html_to_markdown +- name: inline_css +- name: inky_to_html +- name: join +- name: json_encode +- name: keys +- name: language_name +- name: last +- name: length +- name: locale_name +- name: lower +- name: map +- name: markdown_to_html +- name: merge +- name: nl2br +- name: number_format +- name: raw +- name: reduce +- name: replace +- name: reverse +- name: round +- name: slice +- name: slug +- name: sort +- name: spaceless +- name: split +- name: striptags +- name: timezone_name +- name: title +- name: trim +- name: u +- name: upper +- name: url_encode diff --git a/website/site/data/twig_functions_builtin.yml b/website/site/data/twig_functions_builtin.yml new file mode 100644 index 00000000..eb618349 --- /dev/null +++ b/website/site/data/twig_functions_builtin.yml @@ -0,0 +1,17 @@ +--- +- name: attribute +- name: block +- name: constant +- name: cycle +- name: date +- name: dump +- name: html_classes +- name: include +- name: max +- name: min +- name: parent +- name: random +- name: range +- name: source +- name: country_timezones +- name: template_from_string diff --git a/website/site/data/twig_tags_builtin.yml b/website/site/data/twig_tags_builtin.yml new file mode 100644 index 00000000..ee5a1f9a --- /dev/null +++ b/website/site/data/twig_tags_builtin.yml @@ -0,0 +1,21 @@ +--- +- name: apply +- name: autoescape +- name: block +- name: cache +- name: deprecated +- name: do +- name: embed +- name: extends +- name: flush +- name: for +- name: from +- name: if +- name: import +- name: include +- name: macro +- name: sandbox +- name: set +- name: use +- name: verbatim +- name: with diff --git a/website/site/data/twig_tests_builtin.yml b/website/site/data/twig_tests_builtin.yml new file mode 100644 index 00000000..0d9e2de0 --- /dev/null +++ b/website/site/data/twig_tests_builtin.yml @@ -0,0 +1,12 @@ +--- +- name: constant +- name: defined +- name: divisible by + slug: divisibleby +- name: empty +- name: even +- name: iterable +- name: 'null' +- name: odd +- name: same as + slug: sameas diff --git a/website/site/pages/2-doc/5-indepth/5-twig-filters.md b/website/site/pages/2-doc/5-indepth/5-twig-filters.md index dac95ef9..01681f2e 100644 --- a/website/site/pages/2-doc/5-indepth/5-twig-filters.md +++ b/website/site/pages/2-doc/5-indepth/5-twig-filters.md @@ -6,6 +6,17 @@ layout: doc # Twig Filters Herbie is using [Twig Filters](https://twig.symfony.com/doc/3.x/filters/index.html) for modifying variables in layout and content files. -In addition to the built-in filters of Twig itself, the following filters are available. +The following filters are available. {{ snippet("@site/snippets/twig_features.twig", {type:"twig_filters"}) }} + +## Built-in Filters + +In addition to the filters mentioned above, Twig's built-in filters are of course also available. +Please note that some of the filters may require the installation of additional Composer packages. + + diff --git a/website/site/pages/2-doc/5-indepth/6-twig-functions.md b/website/site/pages/2-doc/5-indepth/6-twig-functions.md index b074bfcc..64a60c4a 100644 --- a/website/site/pages/2-doc/5-indepth/6-twig-functions.md +++ b/website/site/pages/2-doc/5-indepth/6-twig-functions.md @@ -9,3 +9,14 @@ Herbie is using [Twig Functions](https://twig.symfony.com/doc/3.x/functions/inde In addition to the built-in functions of Twig itself, the following functions are available. {{ snippet("@site/snippets/twig_features.twig", {type:"twig_functions"}) }} + +## Built-in Functions + +In addition to the functions mentioned above, Twig's built-in functions are of course also available. +Please note that some of the functions may require the installation of additional Composer packages. + + diff --git a/website/site/pages/2-doc/5-indepth/8-twig-tags.md b/website/site/pages/2-doc/5-indepth/8-twig-tags.md new file mode 100644 index 00000000..60805a9b --- /dev/null +++ b/website/site/pages/2-doc/5-indepth/8-twig-tags.md @@ -0,0 +1,15 @@ +--- +title: Twig Tags +layout: doc +--- + +# Twig Tags + +Herbie does not provide its own Twig tags, but the tags provided by Twig are of course available. +Please note that some of the tags may require the installation of additional Composer packages. + + diff --git a/website/site/pages/2-doc/5-indepth/8-twig-tests.md b/website/site/pages/2-doc/5-indepth/8-twig-tests.md index d2425e0b..9b6010c8 100644 --- a/website/site/pages/2-doc/5-indepth/8-twig-tests.md +++ b/website/site/pages/2-doc/5-indepth/8-twig-tests.md @@ -9,3 +9,14 @@ Herbie is using [Twig Tests](https://twig.symfony.com/doc/3.x/tests/index.html) In addition to the built-in tests of Twig, the following tests are available. {{ snippet("@site/snippets/twig_features.twig", {type:"twig_tests"}) }} + +## Built-in Tests + +In addition to the tests mentioned above, Twig's built-in tests are of course also available. +Please note that some of the tests may require the installation of additional Composer packages. + +