Extracted Markdown converter to a separate package#3292
Open
mnocon wants to merge 1 commit into
Open
Conversation
|
Preview of modified files: no change to preview. |
mnocon
commented
Jul 15, 2026
| @@ -0,0 +1,92 @@ | |||
| """ | |||
Contributor
Author
There was a problem hiding this comment.
Moved from hooks.py with minimal changes
mnocon
commented
Jul 15, 2026
| @@ -0,0 +1,550 @@ | |||
| """ | |||
Summary
Errors per inputErrors in site/templating/twig_function_reference/recommendations_twig_functions/index.html
|
mnocon
commented
Jul 15, 2026
| mkdocs-autolinks-plugin==0.7.1 | ||
| Jinja2==3.1.6 | ||
| mkdocs-llmstxt | ||
| -e . |
Contributor
Author
There was a problem hiding this comment.
Explanation from Claude for this change:
Prompt: Explain the "-e ." change
The -e . line in requirements.txt (requirements.txt:11 after the diff) tells pip: install the package defined by the pyproject.toml in this directory, in "editable" mode.
Here's why it's there:
Why a package install is needed at all
The refactor made hooks.py and friends into thin shims:
from llms_txt.hooks import on_config, on_page_content
For import llms_txt to work, Python needs llms_txt to be an installed package on sys.path — it's not enough for tools/llms_txt/ to just exist as a directory in the repo, because nothing adds tools/ to sys.path by default. The old code manually did sys.path.insert(0, ...); the new code relies on the package being properly installed instead.
pyproject.toml declares where that package physically lives:
[tool.setuptools]
package-dir = {"" = "tools"}
packages = ["llms_txt"]
So pip install . (run from the repo root, where pyproject.toml is — that's what the bare . means) installs the tools/llms_txt/ directory as the top-level importable module llms_txt.
Why -e (editable) instead of a plain install
A normal pip install . copies the package files into your Python environment's site-packages. If you then edit tools/llms_txt/hooks.py, your installed copy is stale until you reinstall.
pip install -e . instead installs a pointer back to tools/llms_txt/ in the repo. Editing the source is picked up immediately — no reinstall needed. That matters here because this is source code actively being edited (docs build hooks), not a third-party dependency.
Why it's in requirements.txt (not just requirements-dev.txt)
hooks.py is required for every mkdocs build, not just for running tests — so whatever installs dependencies for a real doc build (local, CI, ReadTheDocs) also needs llms_txt importable. Since requirements-dev.txt does -r requirements.txt, adding it to the base file covers both.
| @@ -0,0 +1,131 @@ | |||
| #!/usr/bin/env python3 | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extracted the Markdown converter so that it can be reused in the user doc.
Follow-up to github.com//pull/3161
User doc PR: ibexa/documentation-user#414