-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
Mkdocs serve fails with mkdocs 1.6.0 and simple plugin with merge_docs_dir: false
This error does not occur with mkdocs versions prior to 1.6.0. The issue seems to be related to the Files object handling in the mkdocs-simple-plugin when the merge_docs_dir parameter is set to false.
As a temporary workaround, reverting to an earlier version of mkdocs or setting merge_docs_dir to true avoids the error.
Steps to Reproduce:
Set up an mkdocs project with mkdocs version 1.6.0.
Install and configure the mkdocs-simple-plugin.
Set the merge_docs_dir configuration parameter to false in the mkdocs.yml file.
Run the mkdocs serve command.
Expected Behavior:
The mkdocs server should start without any errors, and the site should be accessible for preview.
Actual Behavior:
node@backstage-docker:/app$ mkdocs --version
mkdocs, version 1.6.0 from /usr/local/lib/python3.9/dist-packages/mkdocs (Python 3.9)
node@backstage-docker:/app$ mkdocs serve
INFO - DeprecationWarning: warning_filter doesn't do anything since
MkDocs 1.2 and will be removed soon. All messages on the
`mkdocs` logger get counted automatically.
File
"/usr/local/lib/python3.9/dist-packages/mkdocs_monorepo_plugin/parser.py",
line 22, in <module>
from mkdocs.utils import yaml_load, warning_filter,
dirname_to_title, get_markdown_title
File
"/usr/local/lib/python3.9/dist-packages/mkdocs/utils/__init__.py",
line 403, in __getattr__
warnings.warn(
INFO - Building documentation...
INFO - mkdocs-simple-plugin: build_dir: /tmp/mkdocs_simple_xgfrtozg
INFO - Cleaning site directory
INFO - mkdocs-simple-plugin: Added README.md
INFO - mkdocs-simple-plugin: Added CHANGELOG.md
INFO - DeprecationWarning: Do not access Files._files.
File
"/usr/local/lib/python3.9/dist-packages/mkdocs_simple_plugin/plugin.py",
line 376, in on_files
for file in files._files[:]:
File
"/usr/local/lib/python3.9/dist-packages/mkdocs/structure/files.py",
line 172, in _files
warnings.warn("Do not access Files._files.",
DeprecationWarning)
Traceback (most recent call last):
File "/usr/local/bin/mkdocs", line 8, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/mkdocs/__main__.py", line 268, in serve_command
serve.serve(**kwargs)
File "/usr/local/lib/python3.9/dist-packages/mkdocs/commands/serve.py", line 85, in serve
builder(config)
File "/usr/local/lib/python3.9/dist-packages/mkdocs/commands/serve.py", line 67, in builder
build(config, serve_url=None if is_clean else serve_url, dirty=is_dirty)
File "/usr/local/lib/python3.9/dist-packages/mkdocs/commands/build.py", line 292, in build
files = config.plugins.on_files(files, config=config)
File "/usr/local/lib/python3.9/dist-packages/mkdocs/plugins.py", line 593, in on_files
return self.run_event('files', files, config=config)
File "/usr/local/lib/python3.9/dist-packages/mkdocs/plugins.py", line 566, in run_event
result = method(item, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/mkdocs_simple_plugin/plugin.py", line 376, in on_files
for file in files._files[:]:
TypeError: 'Files' object is not subscriptable
mkdocs.yml:
site_name: 'Backstage Documentation'
repo_url: https://...
edit_uri: edit/main
nav:
- README: README.md
- CHANGELOG: CHANGELOG.md
plugins:
- techdocs-core
- simple:
folders: ["./CHANGELOG.md", "./README.md"]
merge_docs_dir: false
Metadata
Metadata
Assignees
Labels
No labels