Skip to content

bug: [0.3.1] KeyError of missing markdown file #23

@15r10nk

Description

@15r10nk

Description of the bug

hi, First of all I want to thank you in the name of every AI out there for this package.
I use mkdocs-llmstxt for inline-snapshot but it causes an error when I want to build my documentation.

The problem appeared with 0.3.1

To Reproduce

Example:

git clone git@github.com:15r10nk/inline-snapshot.git cd inline-snapshot hatch run docs:build 

The problem can be reproduced on the current main (b9c74b5ce7fea8b95469560d067267510ea6b64e)

Full traceback

Full traceback
INFO - Cleaning site directory INFO - Building documentation to directory: /home/frank/projects/inline-snapshot/site Traceback (most recent call last): File "/home/frank/.local/share/hatch/env/virtual/inline-snapshot/aNUSQRQv/docs/bin/mkd ocs", line 10, in <module> sys.exit(cli()) ^^^^^ File "/home/frank/.local/share/hatch/env/virtual/inline-snapshot/aNUSQRQv/docs/lib/pyt hon3.12/site-packages/click/core.py", line 1442, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/frank/.local/share/hatch/env/virtual/inline-snapshot/aNUSQRQv/docs/lib/pyt hon3.12/site-packages/click/core.py", line 1363, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/home/frank/.local/share/hatch/env/virtual/inline-snapshot/aNUSQRQv/docs/lib/pyt hon3.12/site-packages/click/core.py", line 1830, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/frank/.local/share/hatch/env/virtual/inline-snapshot/aNUSQRQv/docs/lib/pyt hon3.12/site-packages/click/core.py", line 1226, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/frank/.local/share/hatch/env/virtual/inline-snapshot/aNUSQRQv/docs/lib/pyt hon3.12/site-packages/click/core.py", line 794, in invoke return callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/frank/.local/share/hatch/env/virtual/inline-snapshot/aNUSQRQv/docs/lib/pyt hon3.12/site-packages/mkdocs/__main__.py", line 288, in build_command build.build(cfg, dirty=not clean) File "/home/frank/.local/share/hatch/env/virtual/inline-snapshot/aNUSQRQv/docs/lib/pyt hon3.12/site-packages/mkdocs/commands/build.py", line 347, in build config.plugins.on_post_build(config=config) File "/home/frank/.local/share/hatch/env/virtual/inline-snapshot/aNUSQRQv/docs/lib/pyt hon3.12/site-packages/mkdocs/plugins.py", line 602, in on_post_build return self.run_event('post_build', config=config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/frank/.local/share/hatch/env/virtual/inline-snapshot/aNUSQRQv/docs/lib/pyt hon3.12/site-packages/mkdocs/plugins.py", line 568, in run_event result = method(**kwargs) ^^^^^^^^^^^^^^^^ File "/home/frank/.local/share/hatch/env/virtual/inline-snapshot/aNUSQRQv/docs/lib/pyt hon3.12/site-packages/mkdocs_llmstxt/_internal/plugin.py", line 176, in on_post_build page_title, path_md, md_url, content = self._md_pages[page_uri] ~~~~~~~~~~~~~~^^^^^^^^^^ KeyError: 'third-party.md'

Expected behavior

It would be nice if I could build my docs again 😄

Environment information

hatch run docs:python -m mkdocs_llmstxt._internal.debug - __System__: Linux-6.1.0-27-amd64-x86_64-with-glibc2.36 - __Python__: cpython 3.12.6 (/home/frank/.local/share/hatch/env/virtual/inline-snapshot /aNUSQRQv/docs/bin/python) - __Environment variables__: - __Installed packages__: - `mkdocs-llmstxt` v0.3.1

PASTE MARKDOWN OUTPUT HERE

Additional context

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions