Closed attie closed 1 year ago
permitting individual pages to "opt-in" using
ignore_macros: true
, instead of only "opt-out" usingignore_macros: false
.
You mean this the other way round, right? Oh, I see what you mean. It could be set to ignore_macros: false
to opt-in, when it's set to true
globally. Double-negatives can be confusing. 😁ignore_macros: true
globally to allow pages to opt-in. I misunderstood the context!
If it were my design, I'd have this config renamed to something like enabled
, or enable_macros
, set to true
globally by default. Then pages could opt-out with enable_macros: false
, or inversely you could disable globally in MkDocs config and use enable_macros: true
on a page to opt in.
Double-negatives can be confusing
Hah...
It could be set to ignore_macros: true globally to allow pages to opt-in.
Yeah, exactly - disable macros globally, and then re-enable them for the pages that need to use macros.
If it were my design
If I was implementing it fom scratch, I would probably have picked upright logic too (rather than inverted)... but I didn't want to disrupt / confuse the ignore_macros
that is already present at the page level... This way, we keep a setting (ignore_macros
), which can now be set globally, and overridden on a per-page basis.
This is attached to issue #162 (a slightly different solution was adopted).
I really like that solution! 🙌
Thanks a lot for your helpful contribution.
I have many, many pages, but would like to use Jinja2 rendering on only one new page. This patch will make the
ignore_macros
configuration available at the global level, effectively permitting individual pages to "opt-in" usingignore_macros: true
, instead of only "opt-out" usingignore_macros: false
.