NiklasRosenstein / pydoc-markdown

Create Python API documentation in Markdown format.
http://niklasrosenstein.github.io/pydoc-markdown/
Other
453 stars 102 forks source link

"Static vs. generated Markdown files" example does not work #264

Closed mgor closed 1 year ago

mgor commented 2 years ago

Environment

Describe the bug

Trying the example of adding generated markdown files to the nav from "Static vs. generated Markdown files".

But it seems like config object hasn't been updated with the nav-tree defined in mkdocs.yaml, which is causing the example to not work:

$ novella
Created temporary build directory /tmp/novella-60fy_2so
Copy ['content/'] to /tmp/novella-60fy_2so
Watch /workspaces/static-vs-generated-markdown-files-issue/content
Detected Git repository URL: https://github.com/mgor/static-vs-generated-markdown-files-issue
Detected edit URI: blob/main/content
{'docs_dir': 'content', 'site_name': 'static-vs-generated-markdown-files-issue', 'theme': {'name': 'material', 'features': ['navigation.indexes', 'navigation.instant', 'navigation.sections', 'navigation.tracking', 'navigation.top', 'toc.follow']}, 'markdown_extensions': ['admonition', 'markdown.extensions.extra', 'meta', 'pymdownx.betterem', 'pymdownx.caret', 'pymdownx.details', 'pymdownx.highlight', 'pymdownx.inlinehilite', 'pymdownx.keys', 'pymdownx.mark', 'pymdownx.smartsymbols', 'pymdownx.superfences', {'pymdownx.tabbed': {'alternate_style': True}}, {'pymdownx.tasklist': {'custom_checkbox': True}}, 'pymdownx.tilde'], 'repo_url': 'https://github.com/mgor/static-vs-generated-markdown-files-issue', 'edit_uri': 'blob/main/content'}
Uncaught exception in action "mkdocs-update-config" defined at /home/vscode/.local/lib/python3.10/site-packages/novella/templates/mkdocs.py:86
Traceback (most recent call last):
  File "/home/vscode/.local/lib/python3.10/site-packages/novella/build.py", line 152, in _run_actions
    action.execute(self)
  File "/home/vscode/.local/lib/python3.10/site-packages/novella/templates/mkdocs.py", line 304, in execute
    mutator(mkdocs_config)
  File "/home/vscode/.local/lib/python3.10/site-packages/craftr/dsl/_runtime.py", line 197, in _wrapper
    return func(__closure__, *args, **kwargs)
  File "build.novella", line 13, in _closure_1_closure_1
    use "pydoc"
KeyError: 'nav'

A repo with a minimal reproducible example can be found here: https://github.com/mgor/static-vs-generated-markdown-files-issue

Expected behavior

That the config object that update_with is called with in the mkdocs-update-config action contains the nav tree from mkdocs.yaml.

mgor commented 2 years ago

Okay, found the root cause... novella only checks for an mkdocs.yml, and does not accept mkdocs.yaml.

NiklasRosenstein commented 2 years ago

Thanks for the report @mgor , I'll take a look when I'm back on the 13th.

NiklasRosenstein commented 1 year ago

Fix is in Novella 0.2.6! Thanks for the PRs @mgor .