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

Proposal: new config option to enable/disable this plugin for mkdocs serve #80

Closed
tombreit opened this issue Mar 1, 2024 · 5 comments
Closed

Comments

@tombreit
Copy link
Contributor

tombreit commented Mar 1, 2024

We now use three mkdocs-git-*-plugins and the execution time is greatly increased by these plugins. This is particularly noticeable during mkdocs serve.

I discovered the enabled_on_serve option at @squidfunk info plugin and implemented this in (my) plugin:

tombreit/mkdocs-git-latest-changes-plugin@f467fec

Would this also be something for mkdocs-git-authors-plugin?

@timvink
Copy link
Owner

timvink commented Mar 3, 2024

I like the idea! Would you be open to contributing a PR?

There are quite some git plugins out there. Ideally, you would only access git information once. I started with the idea for a new mkdocs-git-info-plugin that would serve as an information source for plugins that need git info, but I haven't made the time to complete it. Optimizations like using multiple threads could also take place there.

@squidfunk
Copy link
Collaborator

There are quite some git plugins out there. Ideally, you would only access git information once. I started with the idea for a new mkdocs-git-info-plugin that would serve as an information source for plugins that need git info, but I haven't made the time to complete it. Optimizations like using multiple threads could also take place there.

Yes, yes, yes! One plugin to rule them all, that would be amazing and consolidate efforts big time. We'd switch to it in an instant once it supports the functionality we integrate with in Material for MkDocs ✌️

tombreit added a commit to tombreit/mkdocs-git-authors-plugin that referenced this issue Mar 11, 2024
…epth to 0 to fetch all history for all branches and tags; Bumped actions/checkout to v4
timvink pushed a commit that referenced this issue Mar 12, 2024
… 0 to fetch all history for all branches and tags; Bumped actions/checkout to v4
@tombreit
Copy link
Contributor Author

Hi @timvink , would you also like this functionality for mkdocs-git-revision-date-localized-plugin?

@timvink
Copy link
Owner

timvink commented Mar 12, 2024

Just released the new version to pypi, thanks again!

Hi @timvink , would you also like this functionality for mkdocs-git-revision-date-localized-plugin?

Short answer is yes, go for it!

Long answer is maybe we can do more.. there are many plugins that might want to use this. Have you seen the groups plugin? https://squidfunk.github.io/mkdocs-material/plugins/group/ . Perhaps the right approach is to add a enabled_on_serve parameter there, or just use the env var?

I also feel that enabled and enabled_on_serve are parameters that every mkdocs plugin should have. If you want to push this topic, you could open an issue on the mkdocs project and we discuss it there?

@timvink timvink closed this as completed Mar 12, 2024
@squidfunk
Copy link
Collaborator

@timvink at least enabled should land pretty soon, see mkdocs/mkdocs#3386.

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

No branches or pull requests

3 participants