Macros test page¶
youtube_embed¶
Music not embeddable (when locally hosting):
Own videos are allowed to be embedded:
macros_info¶
Macros Plugin Environment¶
General List¶
All available variables and filters within the macros plugin:
Variable | Type | Content |
---|---|---|
extra | dict | social = [{'icon': 'fontawesome/brands/reddit-alien', 'link': 'https://www.reddit.com/user/_pasadena', 'name': '_pasadena on Reddit'}, {'icon': 'fontawesome/brands/github', 'link': 'https://github.com/upasadena', 'name': 'upasadena on GitHub'}, {'icon': 'fontawesome/brands/discord', 'link': 'https://discord.gg/h9txkD2Tcc', 'name': "Pasadena's discord server"}] |
config | MkDocsConfig | {'config_file_path': '/home/runner/work/interactive-cyoa-tutorial/interactive-cyoa-tutorial/mkdocs.yml', 'site_name': 'Interactive CYOA Creator Tutorial', 'nav': [{'Home': 'https://upasadena.github.io/'}, {'CYOAs': 'https://upasadena.github.io/cyoas/'}, {'Interactive CYOA Tutorial': ['index.md', {'Introduction': ['introduction/index.md']}, {'Basics': ['basics/index.md']}, {'Mechanics': ['mechanics/index.md', {'Rows': 'mechanics/rows.md'}, {'Objects / Choices': 'mechanics/objects.md'}, {'Addons': 'mechanics/addons.md'}, {'Backpack & Choice Import': 'mechanics/backpack-and-choice-import.md'}, {'IDs & Requirements': 'mechanics/ids-and-requirements.md'}, {'Points & Scores': 'mechanics/points-and-scores.md'}, {'Images': 'mechanics/images.md'}, {'Defaults': 'mechanics/defaults.md'}, {'Words': 'mechanics/words.md'}, {'Buttons & Variables': 'mechanics/buttons-and-variables.md'}, {'Groups': 'mechanics/groups.md'}]}, {'Styling': ['styling/index.md', {'Design (WIP)': 'styling/design.md'}, {'Style Templates': 'styling/style-templates.md'}, {'Colours (WIP)': 'styling/colours.md'}, {'Backgrounds': 'styling/backgrounds.md'}]}, {'Creating Your CYOA': ['creating-your-cyoa/index.md']}, {'Extending Your CYOA': ['extending-your-cyoa/index.md']}, {'Publishing': ['publishing/index.md', {'Static': 'publishing/static.md'}, {'Neocities': 'publishing/neocities.md'}, {'GitHub': 'publishing/github.md'}]}, {'Appendix': ['appendix/index.md', {'Reference': 'appendix/reference.md'}, {'Troubleshooting': 'appendix/troubleshooting.md'}, {'Resources': 'appendix/resources.md'}, {'About': 'appendix/about.md'}]}]}], 'pages': None, 'exclude_docs': None, 'draft_docs': None, 'not_in_nav': None, 'site_url': 'https://icctutorial.pages.dev/', 'site_description': 'A complete and comprehensive guide to using the Interactive CYOA Creator by MeanDelay.', 'site_author': 'Pasadena', 'theme': Theme(name='material', dirs=['/home/runner/work/interactive-cyoa-tutorial/interactive-cyoa-tutorial/overrides', '/home/runner/work/interactive-cyoa-tutorial/interactive-cyoa-tutorial/.venv/lib/python3.12/site-packages/material/templates', '/home/runner/work/interactive-cyoa-tutorial/interactive-cyoa-tutorial/.venv/lib/python3.12/site-packages/mkdocs/templates'], static_templates={'404.html', 'sitemap.xml'}, name='material', locale=Locale('en'), language='en', direction=None, features=['navigation.instant', 'navigation.tabs', 'navigation.sections', 'navigation.expand', 'navigation.indexes', 'navigation.footer', 'toc.follow', 'navigation.top', 'search.suggest', 'search.highlight', 'search.share', 'content.action.edit', 'content.action.view', 'content.code.copy'], font={'text': 'Roboto', 'code': 'Roboto Mono'}, icon=None, favicon='assets/images/favicon.png', palette=[{'media': '(prefers-color-scheme: dark)', 'scheme': 'slate', 'toggle': {'icon': 'material/brightness-4', 'name': 'Switch to light mode'}, 'primary': 'deep purple', 'accent': 'deep purple'}, {'media': '(prefers-color-scheme: light)', 'scheme': 'default', 'toggle': {'icon': 'material/brightness-7', 'name': 'Switch to dark mode'}, 'primary': 'deep purple', 'accent': 'deep purple'}]), 'docs_dir': '/home/runner/work/interactive-cyoa-tutorial/interactive-cyoa-tutorial/docs', 'site_dir': '/home/runner/work/interactive-cyoa-tutorial/interactive-cyoa-tutorial/site', 'copyright': 'The content of this website is licensed under the CC0 1.0 licence. It is dedicated to the Public Domain.', 'google_analytics': None, 'dev_addr': _IpAddressValue(host='127.0.0.1', port=8000), 'use_directory_urls': True, 'repo_url': 'https://github.com/upasadena/interactive-cyoa-tutorial', 'repo_name': 'upasadena/interactive-cyoa-tutorial', 'edit_uri_template': None, 'edit_uri': 'edit/main/docs/', 'extra_css': ['css/iframe.css'], 'extra_javascript': ['js/gc.js'], 'extra_templates': [], 'markdown_extensions': ['toc', 'tables', 'fenced_code', 'abbr', 'admonition', 'attr_list', 'pymdownx.emoji', 'def_list', 'footnotes', 'md_in_html', 'pymdownx.caret', 'pymdownx.mark', 'pymdownx.tilde', 'pymdownx.details', 'pymdownx.highlight', 'pymdownx.superfences', 'pymdownx.inlinehilite', 'pymdownx.keys', 'pymdownx.smartsymbols', 'pymdownx.snippets', 'pymdownx.tabbed', 'pymdownx.tasklist', 'pymdownx.magiclink'], 'mdx_configs': {'pymdownx.emoji': {'emoji_index': |
environment | dict | system = 'Linux', system_version = '6.5.0-1024-azure', python_version = '3.12.4', mkdocs_version = '1.6.0', macros_plugin_version = '1.0.5', jinja2_version = '3.1.4' |
plugin | LegacyConfig | {'module_name': 'main', 'modules': [], 'render_by_default': True, 'include_dir': '', 'include_yaml': [], 'j2_block_start_string': '', 'j2_block_end_string': '', 'j2_variable_start_string': '', 'j2_variable_end_string': '', 'on_undefined': 'keep', 'on_error_fail': False, 'verbose': False} |
git | dict | status = True, date [datetime], short_commit = 'e1c678c', commit = 'e1c678c830db7c9031380a3c304aa44b3995ec3c', tag = 'v0.17.0-57-ge1c678c', short_tag = 'v0.17.0', author = 'upasadena', author_email = 'underscore.pasadena@gmail.com', committer = 'upasadena', committer_email = 'underscore.pasadena@gmail.com', date_ISO = 'Tue Jul 30 19:40:17 2024 +0000', message = 'Alpha v0.18.0-u51 - Change by DelicateIntegral', raw = 'commit e1c678c830db7c9031380a3c304aa44b3995ec3c\nAuthor: upasadena |
social | list | [{'icon': 'fontawesome/brands/reddit-alien', 'link': 'https://www.reddit.com/user/_pasadena', 'name': '_pasadena on Reddit'}, {'icon': 'fontawesome/brands/github', 'link': 'https://github.com/upasadena', 'name': 'upasadena on GitHub'}, {'icon': 'fontawesome/brands/discord', 'link': 'https://discord.gg/h9txkD2Tcc', 'name': "Pasadena's discord server"}] |
macros | SuperDict | context [function], macros_info [function], now [function], fix_url [function], youtube_embed [function], readtime_as_seconds [function], words_format [function] |
filters | dict | pretty [function] |
filters_builtin | dict | abs [builtin_function_or_method], attr [function], batch [function], capitalize [function], center [function], count [builtin_function_or_method], d [function], default [function], dictsort [function], e [builtin_function_or_method], escape [builtin_function_or_method], filesizeformat [function], first [function], float [function], forceescape [function], format [function], groupby [function], indent [function], int [function], join [function], last [function], length [builtin_function_or_method], list [function], lower [function], items [function], map [function], min [function], max [function], pprint [function], random [function], reject [function], rejectattr [function], replace [function], reverse [function], round [function], safe [function], select [function], selectattr [function], slice [function], sort [function], string [builtin_function_or_method], striptags [function], sum [function], title [function], trim [function], truncate [function], unique [function], upper [function], urlencode [function], urlize [function], wordcount [function], wordwrap [function], xmlattr [function], tojson [function] |
navigation | Navigation | |
files | Files | |
page | Page | Page(title='Macros test page', url='/static/macros/') |
Config Information¶
Standard MkDocs configuration information. Do not try to modify.
e.g. {{ config.docs_dir }}
See also the MkDocs documentation on the config object.
Variable | Type | Content |
---|---|---|
config_file_path | str | '/home/runner/work/interactive-cyoa-tutorial/interactive-cyoa-tutorial/mkdocs.yml' |
site_name | str | 'Interactive CYOA Creator Tutorial' |
nav | list | [{'Home': 'https://upasadena.github.io/'}, {'CYOAs': 'https://upasadena.github.io/cyoas/'}, {'Interactive CYOA Tutorial': ['index.md', {'Introduction': ['introduction/index.md']}, {'Basics': ['basics/index.md']}, {'Mechanics': ['mechanics/index.md', {'Rows': 'mechanics/rows.md'}, {'Objects / Choices': 'mechanics/objects.md'}, {'Addons': 'mechanics/addons.md'}, {'Backpack & Choice Import': 'mechanics/backpack-and-choice-import.md'}, {'IDs & Requirements': 'mechanics/ids-and-requirements.md'}, {'Points & Scores': 'mechanics/points-and-scores.md'}, {'Images': 'mechanics/images.md'}, {'Defaults': 'mechanics/defaults.md'}, {'Words': 'mechanics/words.md'}, {'Buttons & Variables': 'mechanics/buttons-and-variables.md'}, {'Groups': 'mechanics/groups.md'}]}, {'Styling': ['styling/index.md', {'Design (WIP)': 'styling/design.md'}, {'Style Templates': 'styling/style-templates.md'}, {'Colours (WIP)': 'styling/colours.md'}, {'Backgrounds': 'styling/backgrounds.md'}]}, {'Creating Your CYOA': ['creating-your-cyoa/index.md']}, {'Extending Your CYOA': ['extending-your-cyoa/index.md']}, {'Publishing': ['publishing/index.md', {'Static': 'publishing/static.md'}, {'Neocities': 'publishing/neocities.md'}, {'GitHub': 'publishing/github.md'}]}, {'Appendix': ['appendix/index.md', {'Reference': 'appendix/reference.md'}, {'Troubleshooting': 'appendix/troubleshooting.md'}, {'Resources': 'appendix/resources.md'}, {'About': 'appendix/about.md'}]}]}] |
pages | NoneType | None |
exclude_docs | NoneType | None |
draft_docs | NoneType | None |
not_in_nav | NoneType | None |
site_url | str | 'https://icctutorial.pages.dev/' |
site_description | str | 'A complete and comprehensive guide to using the Interactive CYOA Creator by MeanDelay.' |
site_author | str | 'Pasadena' |
theme | Theme | Theme(name='material', dirs=['/home/runner/work/interactive-cyoa-tutorial/interactive-cyoa-tutorial/overrides', '/home/runner/work/interactive-cyoa-tutorial/interactive-cyoa-tutorial/.venv/lib/python3.12/site-packages/material/templates', '/home/runner/work/interactive-cyoa-tutorial/interactive-cyoa-tutorial/.venv/lib/python3.12/site-packages/mkdocs/templates'], static_templates={'404.html', 'sitemap.xml'}, name='material', locale=Locale('en'), language='en', direction=None, features=['navigation.instant', 'navigation.tabs', 'navigation.sections', 'navigation.expand', 'navigation.indexes', 'navigation.footer', 'toc.follow', 'navigation.top', 'search.suggest', 'search.highlight', 'search.share', 'content.action.edit', 'content.action.view', 'content.code.copy'], font={'text': 'Roboto', 'code': 'Roboto Mono'}, icon=None, favicon='assets/images/favicon.png', palette=[{'media': '(prefers-color-scheme: dark)', 'scheme': 'slate', 'toggle': {'icon': 'material/brightness-4', 'name': 'Switch to light mode'}, 'primary': 'deep purple', 'accent': 'deep purple'}, {'media': '(prefers-color-scheme: light)', 'scheme': 'default', 'toggle': {'icon': 'material/brightness-7', 'name': 'Switch to dark mode'}, 'primary': 'deep purple', 'accent': 'deep purple'}]) |
docs_dir | str | '/home/runner/work/interactive-cyoa-tutorial/interactive-cyoa-tutorial/docs' |
site_dir | str | '/home/runner/work/interactive-cyoa-tutorial/interactive-cyoa-tutorial/site' |
copyright | str | 'The content of this website is licensed under the CC0 1.0 licence. It is dedicated to the Public Domain.' |
google_analytics | NoneType | None |
dev_addr | _IpAddressValue | _IpAddressValue(host='127.0.0.1', port=8000) |
use_directory_urls | bool | True |
repo_url | str | 'https://github.com/upasadena/interactive-cyoa-tutorial' |
repo_name | str | 'upasadena/interactive-cyoa-tutorial' |
edit_uri_template | NoneType | None |
edit_uri | str | 'edit/main/docs/' |
extra_css | list | ['css/iframe.css'] |
extra_javascript | list | ['js/gc.js'] |
extra_templates | list | [] |
markdown_extensions | list | ['toc', 'tables', 'fenced_code', 'abbr', 'admonition', 'attr_list', 'pymdownx.emoji', 'def_list', 'footnotes', 'md_in_html', 'pymdownx.caret', 'pymdownx.mark', 'pymdownx.tilde', 'pymdownx.details', 'pymdownx.highlight', 'pymdownx.superfences', 'pymdownx.inlinehilite', 'pymdownx.keys', 'pymdownx.smartsymbols', 'pymdownx.snippets', 'pymdownx.tabbed', 'pymdownx.tasklist', 'pymdownx.magiclink'] |
mdx_configs | dict | pymdownx.emoji [dict], toc [dict], pymdownx.highlight [dict], pymdownx.superfences [dict], pymdownx.snippets [dict], pymdownx.tabbed [dict], pymdownx.tasklist [dict], pymdownx.magiclink [dict] |
strict | bool | False |
remote_branch | str | 'gh-pages' |
remote_name | str | 'origin' |
extra | LegacyConfig | {'social': [{'icon': 'fontawesome/brands/reddit-alien', 'link': 'https://www.reddit.com/user/_pasadena', 'name': '_pasadena on Reddit'}, {'icon': 'fontawesome/brands/github', 'link': 'https://github.com/upasadena', 'name': 'upasadena on GitHub'}, {'icon': 'fontawesome/brands/discord', 'link': 'https://discord.gg/h9txkD2Tcc', 'name': "Pasadena's discord server"}]} |
plugins | PluginCollection | material/search [SearchPlugin], git-revision-date-localized [GitRevisionDateLocalizedPlugin], git-authors [GitAuthorsPlugin], minify [MinifyPlugin], macros [MacrosPlugin] |
hooks | dict | |
watch | list | ['/home/runner/work/interactive-cyoa-tutorial/interactive-cyoa-tutorial/overrides', '/home/runner/work/interactive-cyoa-tutorial/interactive-cyoa-tutorial/includes', '/home/runner/work/interactive-cyoa-tutorial/interactive-cyoa-tutorial/main.py'] |
validation | Validation | {'nav': {'omitted_files': 20, 'not_found': 30, 'absolute_links': 20}, 'links': {'not_found': 30, 'absolute_links': 20, 'unrecognized_links': 20, 'anchors': 20}} |
Macros¶
These macros have been defined programmatically for this environment (module or pluglets).
Variable | Type | Content |
---|---|---|
{'context': | SuperDict | {'context': |
Git Information¶
Information available on the last commit and the git repository containing the documentation project:
e.g. {{ git.message }}
Variable | Type | Content |
---|---|---|
status | bool | True |
date | datetime | datetime.datetime(2024, 7, 30, 19, 40, 17, tzinfo=tzlocal()) |
short_commit | str | 'e1c678c' |
commit | str | 'e1c678c830db7c9031380a3c304aa44b3995ec3c' |
tag | str | 'v0.17.0-57-ge1c678c' |
short_tag | str | 'v0.17.0' |
author | str | 'upasadena' |
author_email | str | 'underscore.pasadena@gmail.com' |
committer | str | 'upasadena' |
committer_email | str | 'underscore.pasadena@gmail.com' |
date_ISO | str | 'Tue Jul 30 19:40:17 2024 +0000' |
message | str | 'Alpha v0.18.0-u51 - Change by DelicateIntegral' |
raw | str | 'commit e1c678c830db7c9031380a3c304aa44b3995ec3c\nAuthor: upasadena |
root_dir | str | '/home/runner/work/interactive-cyoa-tutorial/interactive-cyoa-tutorial' |
Page Attributes¶
Provided by MkDocs. These attributes change for every page (the attributes shown are for this page).
e.g. {{ page.title }}
See also the MkDocs documentation on the page object.
Variable | Type | Content |
---|---|---|
file | File | src_uri = 'static/macros.md', src_dir = '/home/runner/work/interactive-cyoa-tutorial/interactive-cyoa-tutorial/docs', dest_dir = '/home/runner/work/interactive-cyoa-tutorial/interactive-cyoa-tutorial/site', use_directory_urls = True, inclusion [InclusionLevel], name = 'macros', dest_uri = 'static/macros/index.html', abs_src_path = '/home/runner/work/interactive-cyoa-tutorial/interactive-cyoa-tutorial/docs/static/macros.md', page [Page], url = 'static/macros/' |
children | NoneType | None |
previous_page | NoneType | None |
next_page | NoneType | None |
_Page__active | bool | False |
update_date | str | '2024-07-30' |
canonical_url | str | 'https://icctutorial.pages.dev/static/macros/' |
abs_url | str | '/static/macros/' |
edit_url | str | 'https://github.com/upasadena/interactive-cyoa-tutorial/edit/main/docs/static/macros.md' |
markdown | str | '# Macros test page\n\n## youtube_embed\n\nMusic not embeddable (when locally hosting):\n{{ youtube_embed("dQw4w9WgXcQ") }}\n\nOwn videos are allowed to be embedded:\n{{ youtube_embed("7pFnjGsQL7E") }}\n\n## macros_info\n\n{{ macros_info() }}' |
_title_from_render | NoneType | None |
content | NoneType | None |
toc | list | [] |
meta | dict | git_revision_date_localized = 'July 21, 2023', git_revision_date_localized_raw_date = 'July 21, 2023', git_revision_date_localized_raw_datetime = 'July 21, 2023 11:30:16', git_revision_date_localized_raw_iso_date = '2023-07-21', git_revision_date_localized_raw_iso_datetime = '2023-07-21 11:30:16', git_revision_date_localized_raw_timeago = '', git_revision_date_localized_raw_custom = '21. July 2023', git_site_revision_date_localized = 'July 30, 2024', git_site_revision_date_localized_raw_date = 'July 30, 2024', git_site_revision_date_localized_raw_datetime = 'July 30, 2024 19:40:17', git_site_revision_date_localized_raw_iso_date = '2024-07-30', git_site_revision_date_localized_raw_iso_datetime = '2024-07-30 19:40:17', git_site_revision_date_localized_raw_timeago = '', git_site_revision_date_localized_raw_custom = '30. July 2024', git_creation_date_localized = 'July 20, 2023', git_creation_date_localized_raw_date = 'July 20, 2023', git_creation_date_localized_raw_datetime = 'July 20, 2023 05:36:37', git_creation_date_localized_raw_iso_date = '2023-07-20', git_creation_date_localized_raw_iso_datetime = '2023-07-20 05:36:37', git_creation_date_localized_raw_timeago = '', git_creation_date_localized_raw_custom = '20. July 2023' |
To have all titles of all pages, use:
Plugin Filters¶
These filters are provided as a standard by the macros plugin.
Variable | Type | Content |
---|---|---|
pretty | function | (var_list, var, var_type, content, rows, header, e) Default mkdocs_macro Prettify a dictionary or object (used for environment documentation, or debugging). |
Builtin Jinja2 Filters¶
These filters are provided by Jinja2 as a standard.
See also the Jinja2 documentation on builtin filters).
Variable | Type | Content |
---|---|---|
abs | builtin_function_or_method | Return the absolute value of the argument. |
attr | function | (environment, obj, name, value) Get an attribute of an object. |
batch | function | (value, linecount, fill_with, tmp, item) A filter that batches items. It works pretty much like |
capitalize | function | (s) Capitalize a value. The first character will be uppercase, all others lowercase. |
center | function | (value, width) Centers the value in a field of a given width. |
count | builtin_function_or_method | Return the number of items in a container. |
d | function | (value, default_value, boolean) If the value is undefined it will return the passed default value, otherwise the value of the variable. |
default | function | (value, default_value, boolean) If the value is undefined it will return the passed default value, otherwise the value of the variable. |
dictsort | function | (value, case_sensitive, by, reverse, sort_func) Sort a dict and yield (key, value) pairs. Python dicts may not be in the order you want to display them in, so sort them first. |
e | builtin_function_or_method | Replace the characters |
escape | builtin_function_or_method | Replace the characters |
filesizeformat | function | (value, binary, bytes, base, prefixes, i, prefix, unit) Format the value like a 'human-readable' file size (i.e. 13 kB, 4.1 MB, 102 Bytes, etc). Per default decimal prefixes are used (Mega, Giga, etc.), if the second parameter is set to |
first | function | (args, kwargs, b) Return the first item of a sequence. |
float | function | (value, default) Convert the value into a floating point number. If the conversion doesn't work it will return |
forceescape | function | (value) Enforce HTML escaping. This will probably double escape variables. |
format | function | (value, args, kwargs) Apply the given values to a |
groupby | function | (args, kwargs, b) Group a sequence of objects by an attribute using Python's :func: |
indent | function | (s, width, first, blank, newline, rv, lines) Return a copy of the string with each line indented by 4 spaces. The first line and blank lines are not indented by default. |
int | function | (value, default, base) Convert the value into an integer. If the conversion doesn't work it will return |
join | function | (args, kwargs, b) Return a string which is the concatenation of the strings in the sequence. The separator between elements is an empty string per default, you can define it with the optional parameter. |
last | function | (environment, seq) Return the last item of a sequence. |
length | builtin_function_or_method | Return the number of items in a container. |
list | function | (args, kwargs, b) Convert the value into a list. If it was a string the returned list will be a list of characters. |
lower | function | (s) Convert a value to lowercase. |
items | function | (value) Return an iterator over the |
map | function | (args, kwargs, b) Applies a filter on a sequence of objects or looks up an attribute. This is useful when dealing with lists of objects but you are really only interested in a certain value of it. |
min | function | (environment, value, case_sensitive, attribute) Return the smallest item from the sequence. |
max | function | (environment, value, case_sensitive, attribute) Return the largest item from the sequence. |
pprint | function | (value) Pretty print a variable. Useful for debugging. |
random | function | (context, seq) Return a random item from the sequence. |
reject | function | (args, kwargs, b) Filters a sequence of objects by applying a test to each object, and rejecting the objects with the test succeeding. |
rejectattr | function | (args, kwargs, b) Filters a sequence of objects by applying a test to the specified attribute of each object, and rejecting the objects with the test succeeding. |
replace | function | (eval_ctx, s, old, new, count) Return a copy of the value with all occurrences of a substring replaced with a new one. The first argument is the substring that should be replaced, the second is the replacement string. If the optional third argument |
reverse | function | (value, rv, e) Reverse the object or return an iterator that iterates over it the other way round. |
round | function | (value, precision, method, func) Round the number to a given precision. The first parameter specifies the precision (default is |
safe | function | (value) Mark the value as safe which means that in an environment with automatic escaping enabled this variable will not be escaped. |
select | function | (args, kwargs, b) Filters a sequence of objects by applying a test to each object, and only selecting the objects with the test succeeding. |
selectattr | function | (args, kwargs, b) Filters a sequence of objects by applying a test to the specified attribute of each object, and only selecting the objects with the test succeeding. |
slice | function | (args, kwargs, b) Slice an iterator and return a list of lists containing those items. Useful if you want to create a div containing three ul tags that represent columns. |
sort | function | (environment, value, reverse, case_sensitive, attribute, key_func) Sort an iterable using Python's :func: |
string | builtin_function_or_method | Convert an object to a string if it isn't already. This preserves a :class: |
striptags | function | (value) Strip SGML/XML tags and replace adjacent whitespace by one space. |
sum | function | (args, kwargs, b) Returns the sum of a sequence of numbers plus the value of parameter 'start' (which defaults to 0). When the sequence is empty it returns start. |
title | function | (s, item) Return a titlecased version of the value. I.e. words will start with uppercase letters, all remaining characters are lowercase. |
trim | function | (value, chars) Strip leading and trailing characters, by default whitespace. |
truncate | function | (env, s, length, killwords, end, leeway, result) Return a truncated copy of the string. The length is specified with the first parameter which defaults to |
unique | function | (environment, value, case_sensitive, attribute, getter, seen, item, key) Returns a list of unique items from the given iterable. |
upper | function | (s) Convert a value to uppercase. |
urlencode | function | (value, items) Quote data for use in a URL path or query using UTF-8. |
urlize | function | (eval_ctx, value, trim_url_limit, nofollow, target, rel, extra_schemes, policies, rel_parts, scheme, rv) Convert URLs in text into clickable links. |
wordcount | function | (s) Count the words in that string. |
wordwrap | function | (environment, s, width, break_long_words, wrapstring, break_on_hyphens, textwrap, line) Wrap a string to the given width. Existing newlines are treated as paragraphs to be wrapped separately. |
xmlattr | function | (eval_ctx, d, autospace, items, key, value, rv) Create an SGML/XML attribute string based on the items in a dict. |
tojson | function | (eval_ctx, value, indent, policies, dumps, kwargs) Serialize an object to a string of JSON, and mark it safe to render in HTML. This filter is only for use in HTML documents. |