Skip to content

Integration of snippets with macros variables #2612

Answered by facelessuser
hellt asked this question in Q&A
Discussion options

You must be logged in to vote

MkDocs Macros is not only run first but it would be run on the file before the Python Markdown process is even run. So Snippets won't even know anything about what macros replaced because everything is replaced long before Python Markdown and its plugins (which Snippets is part of) is even run. I'm unaware of whether MkDocs Macros even provides anything to Python Markdown afterward.

Honestly, if you need these things to work together and you are doing templating via macros, it may make sense to just include files with macros. I don't know how possible that is or not as I've never used macros.

The TL;DR of it all is that you could do something like below to pick a certain file to include, …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@hellt
Comment options

@facelessuser
Comment options

Answer selected by hellt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants