feat: add plugin enabled config option#504
feat: add plugin enabled config option#504pawamoy merged 2 commits intomkdocstrings:masterfrom StefanBRas:disable_plugin_flag
enabled config option#504Conversation
oprypin
left a comment
There was a problem hiding this comment.
This should be part of the config, done like timvink/mkdocs-print-site-plugin@315c2e0
|
Thanks for the link @oprypin. What's the benefit of having the config value as well? |
|
If we use the config, it's also possible to change it while hot reloading without restarting the process (but then we're back to forgetting to revert the change and accidentally committing it) I think the test fails are unrelated to my change by the way, they're also failing on master for me. |
|
Yep, seems like there's some maintenance to do. I'll fix CI tomorrow. |
|
OK I checked the docs again and I see a clear benefit to having a configuration option: it allows users to enable/disable the plugin depending on multiple environment variables. It draws the path to a convention thanks to which you can disable all plugins at once, or just specific ones: plugins:
- plugin_a:
enabled: !ENV [MKDOCS_ENABLE_PLUGINS, MKDOCS_ENABLE_PLUGINA, true]
- plugin_b:
enabled: !ENV [MKDOCS_ENABLE_PLUGINS, MKDOCS_ENABLE_PLUGINB, true]With this config, users can disable both plugins with This would allow even more grouping of plugins. Of course all plugins should provide the same So, @StefanBRas, could you bring the change following what was done in the link @oprypin mentioned? Sorry for the late change of direction. |
|
Sure, I'll do it over the weekend. Should it be an "enabled" option instead of "disabled" to be in line with others plugins then? |
|
Yes! Thanks a lot :) |
enabled config option
pawamoy
left a comment
There was a problem hiding this comment.
Thanks! A few doc-related changes 🙂
Fixes #478.
For the docs entry I guessed that it will be released in version 0.20, this might have to be adjusted.
I considered adding a test but I couldn't see some obvious way to extend the test suite.