-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
[WIP]Add support for --dirty and --dirtyreloead options #248
Conversation
Signed-off-by: AngryMane <regulationdango@gmail.com>
Hi @AngryMane ; long time no see, thanks for yet another contrib :)
As a matter a fact, mkdocs DOES provide a way to let plugins know about its own command line invocation AND the dirty flag using the on_startup event! So you could add a property to the def on_startup(self, command: str, dirty: bool):
"""
Store dirty flag to propagate it to language builds.
"""
self.dirty = dirty and of course use it later in the |
Thank you, I had missed it. I'll correct it. 😄 |
Signed-off-by: AngryMane <regulationdango@gmail.com>
Something is wrong with the behavior... self.building may need to be set False at the end of on_post_build 🤔 |
Signed-off-by: AngryMane <regulationdango@gmail.com>
Signed-off-by: AngryMane <regulationdango@gmail.com>
I understood why the test failed. This PR adds "on_startup" event, so mkdocs create plugin cache, and it causes current_language parameter of one previous test case is left. This is the direct cause of test failed. |
You're almost there @AngryMane ! Keep it up :) |
OK. I fixed. But the commit log is a bit messy, so I'm going to create a new branch and re-create the PR, and close this PR. -> #249 |
Hi! I issued a PR once a long time ago. Long time no see.🙂
description
I found mkdocs supports incremental builds (--dirty and --dirtyreload options), but this plugin does not.
This PR changes to support them.
motivation
If there are many documents, not supporting --dirty and --dirtyreload will cause extra time to build.
(For instance, my documents have been getting larger and larger, eventually taking as long as two minutes to hot reload!)
This PR allows hot reloads to be performed in a fraction of the time.
remarks
Frankly, I think dirty flag should be passed from mkdocs. However, since it is currently not possible to obtain the flag from mkdocs, I implemented this by referencing sys.argv.