ultrabug / mkdocs-static-i18n

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

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

Closed AngryMane closed 11 months ago

AngryMane commented 11 months 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 11 months 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 11 months ago

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

ultrabug commented 11 months ago

Arigato :bow:

AngryMane commented 11 months ago

@ultrabug I fixed. Would you review this PR?

ultrabug commented 11 months ago

Yes, thanks @AngryMane