ultrabug / mkdocs-static-i18n

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

keyrError: 'plugins' with material mkdocs #123

Closed Mara-Li closed 2 years ago

Mara-Li commented 2 years ago

Hello! I try to get work with the plugins, but I always get keyError: plugins when I run mkdocs serve

My config :

plugins:
  - search
  - i18n:
      default_language: en
      docs_structure: folder
      languages:
        en:
          name: English
        fr:
          name: Français

Removing i18n work as expected, so I don't understand :-(

My docs structure is like the same in the docs...

My plugins used :

mkdocs==1.3.0
mkdocs-material==8.3.9
mkdocs-mermaid2-plugin==0.6.0
mkdocs-ezlinked-plugin==0.2.0
mkdocs-awesome-pages-plugin==2.7.0
mdx_breakless_lists==1.0.1
mkdocs-preview-links-plugin==0.3.1
mkdocs-embed-file-plugins==1.2.11
Markdown==3.3.7
mkdocs_custom_fences==0.1.0
mkdocs-git-revision-date-localized-plugin==1.1.0
mkdocs-encryptcontent-plugin==2.2.1
mkdocs-simple-hooks==0.1.5
mkdocs-callouts==1.4.1
mkdocs-custom-tags-attributes==0.1.9
ultrabug commented 2 years ago

Bonjour @Mara-Li

Do you have a public repo I can try this on to reproduce the problem please?

Mara-Li commented 2 years ago

Yeap! You can use this : https://github.com/obsidianMkdocs/obsidian_mkdocs_publisher_docs

The bug occure when running the deepcopy. If I edit the plugin and remove the deepcopy, everything works fine!

ultrabug commented 2 years ago

@Mara-Li just to be sure, you're using latest version of the i18n plugin right?

Because if I remove all you other plugins (quite a few of them can't be installed via pip), I don't reproduce your problem :/

Mara-Li commented 2 years ago

Yup, i use the last update. I tryed everything without the plugin, and checked it was caused by deepcopy here : https://github.com/ultrabug/mkdocs-static-i18n/blob/09155f6c42dfc4e12b4375b62726baccc7cd162b/mkdocs_static_i18n/plugin.py#L225 I removed the deepcopy and i get the build without error ...

ultrabug commented 2 years ago

@Mara-Li then some other plugin must be messing with the config somehow. The i18n plugin can't cope with what all the other available plugins out there do.

But it does need to get its own config deepcopy for each language AFAIK.

ultrabug commented 2 years ago

So unless you can isolate which plugin in your long list of plugins is messing up with i18n there's little I can do I guess.

Mara-Li commented 2 years ago

I will redo my test to check if any plugins interefer with i18n

Mara-Li commented 2 years ago

Okay, I can't repro the error now. Maybe upgrading my plugins was the key. Thank for your work!

ultrabug commented 2 years ago

:+1: