Closed fralau closed 1 year ago
The solution will be to use in the header:
---
# YAML header
render_macros: true
---
Opt-in is set in the config file, by specifying that no page will be rendered by default:
plugins:
- search
- macros:
render_by_default: false
This is the default case. If you want to be explicit, you can set the parameter render_by_default
to true, in the config file.
In the page, use the following directive:
---
# YAML header
render_macros: false
---
This one will be maintained for compatibility (deprecated):
---
# YAML header
ignore_macros: true
---
Would you like me to rework the PR?
@attie Thanks! Actually I just implemented and tested it as I went. I should be able to push it today - few lines of code.
Most of the work is was testing and documentation. But you can be credited with the idea!
@attie @hexus This is pushed, if you wish you can started to test if that works for you?
@fralau Perfect, thanks very much! Any idea when you plan to push to PyPi? (no hurry, I'd just like to know so I can drop the git reference)
Works well for me too, @fralau. Cheers!
I wasn't particularly in need of this global override for my current project, just offering my two cents on #159. ☺️
Nice to have though, and I think it'll be useful for future projects.
Thanks to both of you, for your input and for testing!
That's part of the 1.0.0 project, and I will push it to pypi as soon as it is ready. The more people test it, the better it is!
Large projects sometimes have too many pages, to allow them to change them all.
In those cases, it would be easier to render only the pages that require it.
See PR (not used): https://github.com/fralau/mkdocs_macros_plugin/pull/159#issue-1664812954