Saltar a contenido

Macros Plugin Environment

General List

All available variables and filters within the macros plugin:

Variable Type Content
extra dict version = 1.0, posters = '/img/posters/', social = [{'icon': 'fontawesome/brands/github', 'link': 'https://github.com/pvilas'}, {'icon': 'fontawesome/brands/linkedin', 'link': 'https://www.linkedin.com/in/pvilas/'}, {'icon': 'fontawesome/brands/twitter', 'link': 'https://twitter.com/movimientoanim4'}]
config Config config_file_path = '/Users/pvilas/codigo/animal-movements/mkdocs.yml', site_name = 'moverse.net', nav = [{'Home': 'index.md'}, {'Calentar': [{'El calentamiento': 'calentar/index.md'}, {'Pies y tobillos': 'calentar/pies.md'}, {'Rodillas': 'calentar/rodillas.md'}, {'Caderas': 'calentar/caderas.md'}, {'Brazos': 'calentar/brazos.md'}, {'Cuello': 'calentar/cuello.md'}, {'Espina': 'calentar/calentar_espina.md'}, {'Estirar hombros': 'calentar/estirar_hombros.md'}, {'Burpees': 'calentar/burpees.md'}]}, {'Locomoción': [{'Índice': 'locomocion/index.md'}, {'Animales': [{'Los animales': 'locomocion/animales/index.md'}, {'El gato': 'locomocion/animales/gato.md'}, {'Araña frontal': 'locomocion/animales/aranya_frontal.md'}, {'Araña lateral': 'locomocion/animales/aranya_lateral.md'}, {'El oso': 'locomocion/animales/oso.md'}, {'El cangrejo': 'locomocion/animales/cangrejo.md'}, {'La esfinge': 'locomocion/animales/esfinge.md'}, {'El grillo': 'locomocion/animales/grillo.md'}, {'Perro perezoso': 'locomocion/animales/perro-perezoso.md'}, {'El caimán': 'locomocion/animales/caiman.md'}, {'El chimpancé': 'locomocion/animales/chimpance.md'}, {'Lagartija alta': 'locomocion/animales/lagartija_alta.md'}, {'La lagartija': 'locomocion/animales/lagartija.md'}, {'El triángulo': 'locomocion/animales/triangulo.md'}, {'El balancín': 'locomocion/animales/balancin.md'}]}, {'Caminar': [{'Caminar': 'locomocion/caminar/index.md'}, {'Arquero de pie': 'locomocion/caminar/arquero_de_pie.md'}, {'Recoger del suelo': 'locomocion/caminar/recoger_del_suelo.md'}, {'Buenos días': 'locomocion/caminar/buenos_dias.md'}, {'El ruso': 'locomocion/caminar/el_ruso.md'}, {'El bailarín': 'locomocion/caminar/estiramiento_psoas.md'}, {'Puñetazo en pie': 'locomocion/caminar/punyetazo_en_el_pie.md'}, {'Rotación caderas 1p.': 'locomocion/caminar/rotacion_caderas_sobre_una_pierna.md'}]}, {'Gambas': [{'Las gambas': 'locomocion/gambas/index.md'}, {'Gamba hacia atrás': 'locomocion/gambas/gamba_atras.md'}, {'Gamba hacia adelante': 'locomocion/gambas/gamba_adelante.md'}, {'Gamba lateral': 'locomocion/gambas/gamba_de_lado.md'}]}, {'Cambios de base': [{'Los cambios de base': 'locomocion/base/index.md'}, {'Cambio de base lateral': 'locomocion/base/cambio_base_lateral.md'}, {'Cambio de base frontal': 'locomocion/base/cambio_base_frontal.md'}, {'Levantada técnica': 'locomocion/base/levantada_tecnica.md'}]}, {'Tecnificación': [{'Los ejercicios': 'locomocion/ejercicios/index.md'}, {'Push Up': 'locomocion/ejercicios/pushup.md'}, {'El arquero': 'locomocion/ejercicios/arquero.md'}, {'El arquero bajo': 'locomocion/ejercicios/arquero_bajo.md'}, {'Hanuman Dand': 'locomocion/ejercicios/pushup_pie_adelantado.md'}, {'Prep. Lagartija': 'locomocion/ejercicios/drill_para_lizard.md'}, {'Pushup un brazo': 'locomocion/ejercicios/pushup_un_brazo.md'}, {'Pushup combo': 'locomocion/ejercicios/pushup_combo.md'}, {'Flexión hindú': 'locomocion/ejercicios/flexion_hindu.md'}, {'La pica': 'locomocion/ejercicios/pica.md'}, {'Levantamiento de pies': 'locomocion/ejercicios/levantamiento.md'}]}]}, {'Enfriar': [{'El enfriamiento': 'enfriar/index.md'}, {'El pino': 'enfriar/pino.md'}, {'Psoas': 'enfriar/psoas.md'}, {'Sarvangasana': 'enfriar/sarvangasana.md'}, {'Sirsasana': 'enfriar/sirsasana.md'}]}, {'Series': [{'Dolor lumbar': 'series/quitar_dolor_lumbar.md'}]}, {'Varios': [{'Índice': 'varios/index.md'}, {'Recopilación inicial': 'varios/recopilacion.md'}, {'Mis videos de Pilates': 'varios/pilates.md'}, {'Fuentes': 'varios/fuentes.md'}, {'Próximamente': 'varios/proximamente.md'}, {'Plantilla': 'varios/plantilla.md'}, {'Legal': 'varios/legal.md'}, {'Privacidad': 'varios/privacidad.md'}, {'Cookies': 'varios/cookies.md'}, {'Entorno': 'varios/variables.md'}]}], pages [NoneType], site_url = 'https://moverse.net/', site_description = 'Sitio web de locomoción y movimiento animal. Detalles de cada ejercicio, rutinas, etc.', site_author = 'Pere Vilás (https://github.com/pvilas)', theme [Theme], docs_dir = '/Users/pvilas/codigo/animal-movements/docs', site_dir = '/Users/pvilas/codigo/animal-movements/site', copyright = '@Pere Vilás (pvilas.com)', google_analytics [NoneType], dev_addr [Address], use_directory_urls = True, repo_url = '', repo_name = '', edit_uri = '', extra_css = [], extra_javascript = [], extra_templates = [], markdown_extensions = ['toc', 'tables', 'fenced_code', 'meta', 'attr_list', 'pymdownx.emoji'], mdx_configs [dict], strict = False, remote_branch = 'gh-pages', remote_name = 'origin', extra [SubConfig], plugins [PluginCollection]
environment dict system = 'MacOs', system_version = '10.15.7', python_version = '3.9.1', mkdocs_version = '1.1.2', macros_plugin_version = '0.5.0', jinja2_version = '2.11.2'
plugin Config module_name = 'main', modules = [], include_dir = '', include_yaml = [], j2_block_start_string = '', j2_block_end_string = '', j2_variable_start_string = '', j2_variable_end_string = '', verbose = False
git dict status = True, date [datetime], short_commit = '6ce84fb', commit = '6ce84fb20c7058d85c02be90b4d25b9a26416435', author = 'pvilas', tag = '', date_ISO = '2021-01-22 16:13:32 +0100', message = 'canvi de nom', raw = 'commit 6ce84fb20c7058d85c02be90b4d25b9a26416435\nAuthor: pvilas \nDate: Fri Jan 22 16:13:32 2021 +0100\n\n canvi de nom', root_dir = '/Users/pvilas/codigo/animal-movements'
context function (obj, e)

Default mkdocs_macro List the defined variables

macros_info function ()

Test/debug function: list useful documentation on the mkdocs_macro environment.

now function ()

Get the current time (returns a datetime object). Used alone, it provides a timestamp. To get the year use now().year, for the month number now().month, etc.

fix_url function (url, r)

If url is relative, fix it so that it points to the docs diretory. This is necessary because relative links in markdown must be adapted in html ('img/foo.png' => '../img/img.png').

version float 1.0
posters str '/img/posters/'
social list [{'icon': 'fontawesome/brands/github', 'link': 'https://github.com/pvilas'}, {'icon': 'fontawesome/brands/linkedin', 'link': 'https://www.linkedin.com/in/pvilas/'}, {'icon': 'fontawesome/brands/twitter', 'link': 'https://twitter.com/movimientoanim4'}]
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], 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 Page(title='Home', url='/')
Section(title='Calentar')
Page(title='El calentamiento', url='/calentar/')
Page(title='Pies y tobillos', url='/calentar/pies/')
Page(title='Rodillas', url='/calentar/rodillas/')
Page(title='Caderas', url='/calentar/caderas/')
Page(title='Brazos', url='/calentar/brazos/')
Page(title='Cuello', url='/calentar/cuello/')
Page(title='Espina', url='/calentar/calentar_espina/')
Page(title='Estirar hombros', url='/calentar/estirar_hombros/')
Page(title='Burpees', url='/calentar/burpees/')
Section(title='Locomoción')
Page(title='Índice', url='/locomocion/')
Section(title='Animales')
Page(title='Los animales', url='/locomocion/animales/')
Page(title='El gato', url='/locomocion/animales/gato/')
Page(title='Araña frontal', url='/locomocion/animales/aranya_frontal/')
Page(title='Araña lateral', url='/locomocion/animales/aranya_lateral/')
Page(title='El oso', url='/locomocion/animales/oso/')
Page(title='El cangrejo', url='/locomocion/animales/cangrejo/')
Page(title='La esfinge', url='/locomocion/animales/esfinge/')
Page(title='El grillo', url='/locomocion/animales/grillo/')
Page(title='Perro perezoso', url='/locomocion/animales/perro-perezoso/')
Page(title='El caimán', url='/locomocion/animales/caiman/')
Page(title='El chimpancé', url='/locomocion/animales/chimpance/')
Page(title='Lagartija alta', url='/locomocion/animales/lagartija_alta/')
Page(title='La lagartija', url='/locomocion/animales/lagartija/')
Page(title='El triángulo', url='/locomocion/animales/triangulo/')
Page(title='El balancín', url='/locomocion/animales/balancin/')
Section(title='Caminar')
Page(title='Caminar', url='/locomocion/caminar/')
Page(title='Arquero de pie', url='/locomocion/caminar/arquero_de_pie/')
Page(title='Recoger del suelo', url='/locomocion/caminar/recoger_del_suelo/')
Page(title='Buenos días', url='/locomocion/caminar/buenos_dias/')
Page(title='El ruso', url='/locomocion/caminar/el_ruso/')
Page(title='El bailarín', url='/locomocion/caminar/estiramiento_psoas/')
Page(title='Puñetazo en pie', url='/locomocion/caminar/punyetazo_en_el_pie/')
Page(title='Rotación caderas 1p.', url='/locomocion/caminar/rotacion_caderas_sobre_una_pierna/')
Section(title='Gambas')
Page(title='Las gambas', url='/locomocion/gambas/')
Page(title='Gamba hacia atrás', url='/locomocion/gambas/gamba_atras/')
Page(title='Gamba hacia adelante', url='/locomocion/gambas/gamba_adelante/')
Page(title='Gamba lateral', url='/locomocion/gambas/gamba_de_lado/')
Section(title='Cambios de base')
Page(title='Los cambios de base', url='/locomocion/base/')
Page(title='Cambio de base lateral', url='/locomocion/base/cambio_base_lateral/')
Page(title='Cambio de base frontal', url='/locomocion/base/cambio_base_frontal/')
Page(title='Levantada técnica', url='/locomocion/base/levantada_tecnica/')
Section(title='Tecnificación')
Page(title='Los ejercicios', url='/locomocion/ejercicios/')
Page(title='Push Up', url='/locomocion/ejercicios/pushup/')
Page(title='El arquero', url='/locomocion/ejercicios/arquero/')
Page(title='El arquero bajo', url='/locomocion/ejercicios/arquero_bajo/')
Page(title='Hanuman Dand', url='/locomocion/ejercicios/pushup_pie_adelantado/')
Page(title='Prep. Lagartija', url='/locomocion/ejercicios/drill_para_lizard/')
Page(title='Pushup un brazo', url='/locomocion/ejercicios/pushup_un_brazo/')
Page(title='Pushup combo', url='/locomocion/ejercicios/pushup_combo/')
Page(title='Flexión hindú', url='/locomocion/ejercicios/flexion_hindu/')
Page(title='La pica', url='/locomocion/ejercicios/pica/')
Page(title='Levantamiento de pies', url='/locomocion/ejercicios/levantamiento/')
Section(title='Enfriar')
Page(title='El enfriamiento', url='/enfriar/')
Page(title='El pino', url='/enfriar/pino/')
Page(title='Psoas', url='/enfriar/psoas/')
Page(title='Sarvangasana', url='/enfriar/sarvangasana/')
Page(title='Sirsasana', url='/enfriar/sirsasana/')
Section(title='Series')
Page(title='Dolor lumbar', url='/series/quitar_dolor_lumbar/')
Section(title='Varios')
Page(title='Índice', url='/varios/')
Page(title='Recopilación inicial', url='/varios/recopilacion/')
Page(title='Mis videos de Pilates', url='/varios/pilates/')
Page(title='Fuentes', url='/varios/fuentes/')
Page(title='Próximamente', url='/varios/proximamente/')
Page(title='Plantilla', url='/varios/plantilla/')
Page(title='Legal', url='/varios/legal/')
Page(title='Privacidad', url='/varios/privacidad/')
Page(title='Cookies', url='/varios/cookies/')
Page(title='Entorno', url='/varios/variables/')
page Page Page(title='Entorno', url='/varios/variables/')

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 '/Users/pvilas/codigo/animal-movements/mkdocs.yml'
site_name str 'moverse.net'
nav list [{'Home': 'index.md'}, {'Calentar': [{'El calentamiento': 'calentar/index.md'}, {'Pies y tobillos': 'calentar/pies.md'}, {'Rodillas': 'calentar/rodillas.md'}, {'Caderas': 'calentar/caderas.md'}, {'Brazos': 'calentar/brazos.md'}, {'Cuello': 'calentar/cuello.md'}, {'Espina': 'calentar/calentar_espina.md'}, {'Estirar hombros': 'calentar/estirar_hombros.md'}, {'Burpees': 'calentar/burpees.md'}]}, {'Locomoción': [{'Índice': 'locomocion/index.md'}, {'Animales': [{'Los animales': 'locomocion/animales/index.md'}, {'El gato': 'locomocion/animales/gato.md'}, {'Araña frontal': 'locomocion/animales/aranya_frontal.md'}, {'Araña lateral': 'locomocion/animales/aranya_lateral.md'}, {'El oso': 'locomocion/animales/oso.md'}, {'El cangrejo': 'locomocion/animales/cangrejo.md'}, {'La esfinge': 'locomocion/animales/esfinge.md'}, {'El grillo': 'locomocion/animales/grillo.md'}, {'Perro perezoso': 'locomocion/animales/perro-perezoso.md'}, {'El caimán': 'locomocion/animales/caiman.md'}, {'El chimpancé': 'locomocion/animales/chimpance.md'}, {'Lagartija alta': 'locomocion/animales/lagartija_alta.md'}, {'La lagartija': 'locomocion/animales/lagartija.md'}, {'El triángulo': 'locomocion/animales/triangulo.md'}, {'El balancín': 'locomocion/animales/balancin.md'}]}, {'Caminar': [{'Caminar': 'locomocion/caminar/index.md'}, {'Arquero de pie': 'locomocion/caminar/arquero_de_pie.md'}, {'Recoger del suelo': 'locomocion/caminar/recoger_del_suelo.md'}, {'Buenos días': 'locomocion/caminar/buenos_dias.md'}, {'El ruso': 'locomocion/caminar/el_ruso.md'}, {'El bailarín': 'locomocion/caminar/estiramiento_psoas.md'}, {'Puñetazo en pie': 'locomocion/caminar/punyetazo_en_el_pie.md'}, {'Rotación caderas 1p.': 'locomocion/caminar/rotacion_caderas_sobre_una_pierna.md'}]}, {'Gambas': [{'Las gambas': 'locomocion/gambas/index.md'}, {'Gamba hacia atrás': 'locomocion/gambas/gamba_atras.md'}, {'Gamba hacia adelante': 'locomocion/gambas/gamba_adelante.md'}, {'Gamba lateral': 'locomocion/gambas/gamba_de_lado.md'}]}, {'Cambios de base': [{'Los cambios de base': 'locomocion/base/index.md'}, {'Cambio de base lateral': 'locomocion/base/cambio_base_lateral.md'}, {'Cambio de base frontal': 'locomocion/base/cambio_base_frontal.md'}, {'Levantada técnica': 'locomocion/base/levantada_tecnica.md'}]}, {'Tecnificación': [{'Los ejercicios': 'locomocion/ejercicios/index.md'}, {'Push Up': 'locomocion/ejercicios/pushup.md'}, {'El arquero': 'locomocion/ejercicios/arquero.md'}, {'El arquero bajo': 'locomocion/ejercicios/arquero_bajo.md'}, {'Hanuman Dand': 'locomocion/ejercicios/pushup_pie_adelantado.md'}, {'Prep. Lagartija': 'locomocion/ejercicios/drill_para_lizard.md'}, {'Pushup un brazo': 'locomocion/ejercicios/pushup_un_brazo.md'}, {'Pushup combo': 'locomocion/ejercicios/pushup_combo.md'}, {'Flexión hindú': 'locomocion/ejercicios/flexion_hindu.md'}, {'La pica': 'locomocion/ejercicios/pica.md'}, {'Levantamiento de pies': 'locomocion/ejercicios/levantamiento.md'}]}]}, {'Enfriar': [{'El enfriamiento': 'enfriar/index.md'}, {'El pino': 'enfriar/pino.md'}, {'Psoas': 'enfriar/psoas.md'}, {'Sarvangasana': 'enfriar/sarvangasana.md'}, {'Sirsasana': 'enfriar/sirsasana.md'}]}, {'Series': [{'Dolor lumbar': 'series/quitar_dolor_lumbar.md'}]}, {'Varios': [{'Índice': 'varios/index.md'}, {'Recopilación inicial': 'varios/recopilacion.md'}, {'Mis videos de Pilates': 'varios/pilates.md'}, {'Fuentes': 'varios/fuentes.md'}, {'Próximamente': 'varios/proximamente.md'}, {'Plantilla': 'varios/plantilla.md'}, {'Legal': 'varios/legal.md'}, {'Privacidad': 'varios/privacidad.md'}, {'Cookies': 'varios/cookies.md'}, {'Entorno': 'varios/variables.md'}]}]
pages NoneType None
site_url str 'https://moverse.net/'
site_description str 'Sitio web de locomoción y movimiento animal. Detalles de cada ejercicio, rutinas, etc.'
site_author str 'Pere Vilás (https://github.com/pvilas)'
theme Theme Theme(name='material', dirs=['/Users/pvilas/codigo/animal-movements/overrides', '/Users/pvilas/codigo/animal-movements/venv/lib/python3.9/site-packages/material', '/Users/pvilas/codigo/animal-movements/venv/lib/python3.9/site-packages/mkdocs/templates'], static_templates=['404.html', 'sitemap.xml'], language='es', direction=None, features=['navigation.tabs', 'navigation.sections'], palette={'scheme': 'default'}, font={'text': 'Roboto', 'code': 'Roboto Mono'}, icon=None, favicon='favicon.ico', include_search_page=False, search_index_only=True, logo='img/logo.png')
docs_dir str '/Users/pvilas/codigo/animal-movements/docs'
site_dir str '/Users/pvilas/codigo/animal-movements/site'
copyright str '@Pere Vilás (pvilas.com)'
google_analytics NoneType None
dev_addr Address Address(host='127.0.0.1', port=8000)
use_directory_urls bool True
repo_url str ''
repo_name str ''
edit_uri str ''
extra_css list []
extra_javascript list []
extra_templates list []
markdown_extensions list ['toc', 'tables', 'fenced_code', 'meta', 'attr_list', 'pymdownx.emoji']
mdx_configs dict pymdownx.emoji [dict]
strict bool False
remote_branch str 'gh-pages'
remote_name str 'origin'
extra SubConfig {'version': 1.0, 'posters': '/img/posters/', 'social': [{'icon': 'fontawesome/brands/github', 'link': 'https://github.com/pvilas'}, {'icon': 'fontawesome/brands/linkedin', 'link': 'https://www.linkedin.com/in/pvilas/'}, {'icon': 'fontawesome/brands/twitter', 'link': 'https://twitter.com/movimientoanim4'}]}
plugins PluginCollection macros [MacrosPlugin], search [SearchPlugin]

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(2021, 1, 22, 16, 13, 32, tzinfo=tzoffset(None, 3600))
short_commit str '6ce84fb'
commit str '6ce84fb20c7058d85c02be90b4d25b9a26416435'
author str 'pvilas'
tag str ''
date_ISO str '2021-01-22 16:13:32 +0100'
message str 'canvi de nom'
raw str 'commit 6ce84fb20c7058d85c02be90b4d25b9a26416435\nAuthor: pvilas \nDate: Fri Jan 22 16:13:32 2021 +0100\n\n canvi de nom'
root_dir str '/Users/pvilas/codigo/animal-movements'

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 page [Page], src_path = 'varios/variables.md', abs_src_path = '/Users/pvilas/codigo/animal-movements/docs/varios/variables.md', name = 'variables', dest_path = 'varios/variables/index.html', abs_dest_path = '/Users/pvilas/codigo/animal-movements/site/varios/variables/index.html', url = 'varios/variables/'
title str 'Entorno'
parent Section title = 'Varios', children = [Page(title='Índice', url='/varios/'), Page(title='Recopilación inicial', url='/varios/recopilacion/'), Page(title='Mis videos de Pilates', url='/varios/pilates/'), Page(title='Fuentes', url='/varios/fuentes/'), Page(title='Próximamente', url='/varios/proximamente/'), Page(title='Plantilla', url='/varios/plantilla/'), Page(title='Legal', url='/varios/legal/'), Page(title='Privacidad', url='/varios/privacidad/'), Page(title='Cookies', url='/varios/cookies/'), Page(title='Entorno', url='/varios/variables/')], parent [NoneType], _Section__active = False, is_section = True, is_page = False, is_link = False
children NoneType None
previous_page Page Page(title='Cookies', url='/varios/cookies/')
next_page NoneType None
_Page__active bool False
is_section bool False
is_page bool True
is_link bool False
update_date str '2021-02-14'
canonical_url str 'https://moverse.net/varios/variables/'
abs_url str '/varios/variables/'
edit_url NoneType None
markdown str '{% extends "pagina.jinja" %}\n{% block descripcion %}\n{{ macros_info() }}\n{% endblock %}\n'
content NoneType None
toc list []
meta dict title = 'Variables de generación del sitio web', description = 'moverse.net - Variables de generación del sitio web'

To have all titles of all pages, use:


{% for page in navigation.pages %}
- {{ page.title }}
{% endfor% }

Plugin Filters

These filters are provided as a standard by the macros plugin.

Variable Type Content
pretty function (var_list, 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. foo|attr("bar") works like foo.bar just that always an attribute is returned and items are not looked up.

batch function (value, linecount, fill_with, tmp, item)

A filter that batches items. It works pretty much like slice just the other way round. It returns a list of lists with the given number of items. If you provide a second parameter this is used to fill up missing items. See this example.

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. Because python dicts are unsorted you may want to use this function to order them by either key or value.

e builtin_function_or_method

escape(s) -> markup

escape builtin_function_or_method

escape(s) -> markup

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 True the binary prefixes are used (Mebi, Gibi).

first function (environment, seq)

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 0.0. You can override this default using the first parameter.

forceescape function (value)

Enforce HTML escaping. This will probably double escape variables.

format function (value, args, kwargs)

Apply the given values to a printf-style_ format string, like string % values.

groupby function (environment, value, attribute, expr)

Group a sequence of objects by an attribute using Python's :func:itertools.groupby. The attribute can use dot notation for nested access, like "address.city". Unlike Python's groupby, the values are sorted first so only one group is returned for each unique value.

indent function (s, width, first, blank, indentfirst, 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 0. You can override this default using the first parameter. You can also override the default base (10) in the second parameter, which handles input with prefixes such as 0b, 0o and 0x for bases 2, 8 and 16 respectively. The base is ignored for decimal numbers and non-string values.

join function (eval_ctx, value, d, attribute, do_escape, idx, item)

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 (value)

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.

map function (args, kwargs, seq, func, item)

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, verbose)

Pretty print a variable. Useful for debugging.

random function (context, seq)

Return a random item from the sequence.

reject function (args, kwargs)

Filters a sequence of objects by applying a test to each object, and rejecting the objects with the test succeeding.

rejectattr function (args, kwargs)

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 count is given, only the first count occurrences are replaced.

reverse function (value, rv)

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 0), the second the rounding method.

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)

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)

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 (value, slices, fill_with, seq, length, items_per_slice, slices_with_extra, offset, slice_number, start, end, tmp)

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:sorted.

string builtin_function_or_method

soft_unicode(object) -> string

striptags function (value)

Strip SGML/XML tags and replace adjacent whitespace by one space.

sum function (environment, iterable, attribute, start)

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)

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 255. If the second parameter is true the filter will cut the text at length. Otherwise it will discard the last word. If the text was in fact truncated it will append an ellipsis sign ("..."). If you want a different ellipsis sign than "..." you can specify it using the third parameter. Strings that only exceed the length by the tolerance margin given in the fourth parameter will not be truncated.

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, policies, rv)

Converts URLs in plain 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)

Wrap a string to the given width. Existing newlines are treated as paragraphs to be wrapped separately.

xmlattr function (_eval_ctx, d, autospace, rv)

Create an SGML/XML attribute string based on the items in a dict. All values that are neither none nor undefined are automatically escaped.

tojson function (eval_ctx, value, indent, policies, dumper, options)

Dumps a structure to JSON so that it's safe to use in <script> tags. It accepts the same arguments and returns a JSON string. Note that this is available in templates through the |tojson filter which will also mark the result as safe. Due to how this function escapes certain characters this is safe even if used outside of <script> tags.