This plugin adds a "markdown" template filter to mkdocs.
Install the plugin using pip:
pip install mkdocs-markdown-filter
Activate the plugin in mkdocs.yml
:
plugins:
- search
- markdown-filter
Note: If you have no
plugins
entry in your config file yet, you'll likely also want to add thesearch
plugin. MkDocs enables it by default if there is noplugins
entry set, but now you have to enable it explicitly.
More information about plugins in the MkDocs documentation.
Enabling this plugin will filter jinja template code through a markdown filter:
{% set code_content %}
```php linenums="1"
<?php
foo = 1;
bar = 3;
if (foo == bar ) {
// do something
}
?>
```
{% endset %}
{{ code_content|markdown }}
More information about templates here.
More information about blocks here.