Markdown within HTML template override #5906
-
I am trying to override the However, there are a few things that are slightly easier to do in markdown, such as syntax highlighted code blocks. I didn't find a Jinja tag for code blocks in the {% block tabs %}
<div markdown>
```python
print("Hello World")
```
</div>
{% endblock %} But it doesn't appear to work. Can someone help me figure out how to hijack my way back into markdown from a template? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Judging from the plugin's README, it seems you need to put your Markdown in a file to include it from a template: {% include-markdown "docs/includes/header.md" %} That being said, we already have developed some promising ideas how to govern non-linear pages (like home page templates) from Markdown more easily. We'll explore that in the future and keep you all updated! |
Beta Was this translation helpful? Give feedback.
I will assume that means
mkdocs-material
doesn't have any undocumented template tags for rendering markdown. This could be a good feature for your non-linear pages overhaul?In the meantime, I will PR
mkdocs-include-markdown
to fix the invalid syntax to see if it could potentially help my oddball scenario. Worst case I'll have to semi-manually create codeblocks in myoverrides/home.html
.