Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use key value syntax for Insider plugins example #3783

Merged
merged 4 commits into from Apr 6, 2022

Conversation

cicdw
Copy link
Contributor

@cicdw cicdw commented Mar 30, 2022

I noticed that the official Insiders documentation used hyphenated list syntax when enumerating plugins, but this is not compatible with MkDocs configuration inheritance requirements when merging config files; I assume most people won't click through and read carefully, so this PR updates the documentation to use syntax that will "just work" along with a note.

@squidfunk
Copy link
Owner

Thanks for the PR. I don't think it's a good idea to change the syntax here, because it would be the only part of the documentation using that syntax, which might confuse users. I understand your requirement for merging configurations, though, as you probably don't want to duplicate the plugin setup. Moving forward, I would suggest that we put a note into an admonition explaining the alternate syntax below the configuration inheritance example.

@cicdw
Copy link
Contributor Author

cicdw commented Apr 1, 2022

@squidfunk updated 👍

Copy link
Owner

@squidfunk squidfunk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think we should make the example a little more explicit, see my comments.

If you plan to split `plugins` or `markdown_extensions` between the two files, you must use
alternative key / value syntax for these sections. The above insiders file would then look like:
``` yaml
INHERIT: mkdocs.yml
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we maybe provide two code blocks each for each mkdocs.yml file (base + Insiders overrides) which just adds the social plugin? The other plugins are non-Insiders anyway. This would be a more self-contained example for the user to understand how to do overrides while keeping the plugin configuration of the base configuration. I say we could just add the social plugin as an example. Otherwise, users might start to mix syntaxes, or is that possible?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So essentially something like:

mkdocs.yml

plugins:
  search: {}
  tags: {}

mkdocs.insiders.yml

INHERIT: mkdocs.yml
plugins:
  social {}

Please use the content tabs pattern for this, as in other parts of the documentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your patience with my slow updates - I just pushed the requested changes!

@squidfunk
Copy link
Owner

Perfect, thanks!

@squidfunk squidfunk merged commit dd2268f into squidfunk:master Apr 6, 2022
@cicdw cicdw deleted the insider-plugin-fix branch April 6, 2022 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants