ultrabug / mkdocs-static-i18n

MkDocs i18n plugin using static translation markdown files
https://ultrabug.github.io/mkdocs-static-i18n/
MIT License
237 stars 38 forks source link

add support for --dirty and --dirtyreload #249

Closed AngryMane closed 1 year ago

AngryMane commented 1 year ago

This PR is rework of the following PR. https://github.com/ultrabug/mkdocs-static-i18n/pull/248

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.

ultrabug commented 1 year ago

I'm sorry @AngryMane but I find this solution too complicated compared to the initial sys.argv approach :(

I'd rather accept the previous PR than modify so much things for such a simple feature...

AngryMane commented 1 year ago

@ultrabug I feel the same 😄 I'll rework tomorrow!

ultrabug commented 1 year ago

Arigato :bow:

AngryMane commented 1 year ago

@ultrabug I fixed. Would you review this PR?

ultrabug commented 1 year ago

Yes, thanks @AngryMane