ultrabug / mkdocs-static-i18n

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

[Request] Excluding folders from localization #264

Open usulpt opened 9 months ago

usulpt commented 9 months ago

hello! would it be possible to exclude one or more folders from being localized? api documentation, for example?

thanks and keep up the great work!

ultrabug commented 9 months ago

Hi @usulpt ; it's hard to understand what you mean exactly by this.

Could you provide a sample docs structure and explain from there?

AIboy996 commented 1 month ago

Same issue. Later I will make a pull request on this.

AIboy996 commented 1 month ago

@usulpt hei, I modify some code to support exclude one or more folders from being localized, you can check https://github.com/AIboy996/mkdocs-static-i18n.

It works like: mkdocs-i18n

All files in ignored folder will be redirected to default language page(but not simple redirect, in fact these page will not be built).

FYI, if you want to install the modified version, just type:

pip install git+https://github.com/AIboy996/mkdocs-static-i18n --force-reinstall

then you can ignore some folder inmkdocs.yml:

plugins:
  - search
  - i18n:
      docs_structure: suffix
      exclude_folders:
        - docs/setup

hope it helps.

And @ultrabug maybe this can be considered to include as a formal config option for mkdocs-static-i18n.

AIboy996 commented 1 month ago

Since i am not familar with mkdocs-static-i18n source code enough. I am not sure the modification is appropriate.(it will trigger some WARNINGs from mkdocs.structure.nav.get_navagation) So I won’t initiate a pull request qwq__