jdoiro3 / mkdocs-multirepo-plugin

Build documentation in multiple repos into one site.
MIT License
135 stars 47 forks source link

AttributeError: 'str' object has no attribute 'items' (Not related to `navigation.indexes`) #39

Open the-real-cphillips opened 2 years ago

the-real-cphillips commented 2 years ago

I know this error has come up before and it was determined to be related to navigation.indexes but this is different.

Here's my mkdocs.yml where I'm using multirepo

nav:
  - Home: index.md
  - Tool: '!import https://github.com/{user}/{repo}'

Here is the nav from mkdocs.yaml inside the Tool repo:

nav:
  - Welcome: index.md
  - ...
  - Advanced Features:
    - feature 1: feat1.md

When using !import the error is experienced. If I use the repos section under plugins, there is no problem importing.

Traceback:

  File "~/env/lib/python3.9/site-packages/mkdocs_multirepo_plugin/plugin.py", line 155, in on_config
    return self.handle_nav_based_import(config)
  File "~/env/lib/python3.9/site-packages/mkdocs_multirepo_plugin/plugin.py", line 109, in handle_nav_based_import
    repo_config = repo.load_config()
  File "~/env/lib/python3.9/site-packages/mkdocs_multirepo_plugin/structure.py", line 295, in load_config
    resolve_nav_paths(config.get('nav'), self.name)
  File "~/env/lib/python3.9/site-packages/mkdocs_multirepo_plugin/structure.py", line 27, in resolve_nav_paths
    (key, value), = entry.items()
AttributeError: 'str' object has no attribute 'items'
jdoiro3 commented 2 years ago

@the-real-cphillips, I honestly can tell you for certain at the moment but I think I fixed this in v0.4.4 (the latest version on PYPI). Could you upgrade and let me know if the bug still exists?

the-real-cphillips commented 2 years ago

@jdoiro3 sorry for the delay on this.

So the fix does seem to have stopped the error and is no longer crashing.

However, it now just returns "None" in the place of the ... notation, instead of expanding the ....

I'm happy to help troubleshoot in anyway, please let me know.

image