Name | mkdocs-llmstxt JSON |
Version |
0.3.1
JSON |
| download |
home_page | None |
Summary | MkDocs plugin to generate an /llms.txt file. |
upload_time | 2025-08-05 13:42:41 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | None |
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# mkdocs-llmstxt
[](https://github.com/pawamoy/mkdocs-llmstxt/actions?query=workflow%3Aci)
[](https://pawamoy.github.io/mkdocs-llmstxt/)
[](https://pypi.org/project/mkdocs-llmstxt/)
[](https://app.gitter.im/#/room/#mkdocs-llmstxt:gitter.im)
MkDocs plugin to generate an [/llms.txt file](https://llmstxt.org/).
> /llms.txt - A proposal to standardise on using an /llms.txt file to provide information to help LLMs use a website at inference time.
See our own dynamically generated [/llms.txt](https://pawamoy.github.io/mkdocs-llmstxt/llms.txt) as a demonstration.
## Installation
```bash
pip install mkdocs-llmstxt
```
## Usage
Enable the plugin in `mkdocs.yml`:
```yaml title="mkdocs.yml"
site_name: My project
site_description: Description of my project.
site_url: https://myproject.com/ # Required for the llmstxt plugin to work.
plugins:
- llmstxt:
markdown_description: Long description of my project.
sections:
Usage documentation:
- file1.md: Description of file1
- file2.md # Descriptions are optional.
```
The resulting `/llms.txt` file will be available at the root of your documentation. With the previous example, it will be accessible at https://myproject.com/llms.txt and will contain the following:
```markdown
# My project
> Description of my project.
Long description of my project.
## Usage documentation
- [File1 title](https://myproject.com/file1.md): Description of file1
- [File2 title](https://myproject.com/file2.md)
```
Each source file included in `sections` will have its own Markdown file available at the specified URL in the `/llms.txt`. See [Markdown generation](#markdown-generation) for more details.
File globbing is supported:
```yaml title="mkdocs.yml"
plugins:
- llmstxt:
sections:
Usage documentation:
- index.md: Main documentation page
- usage/*.md
```
## Full output
Although not explicitly written out in the https://llmstxt.org/ guidelines, it is common to output a `llms-full.txt` file with every page content expanded. This file can be generated by setting the `full_output` configuration value:
```yaml title="mkdocs.yml"
plugins:
- llmstxt:
full_output: llms-full.txt
sections:
Usage documentation:
- index.md
- usage/*.md
```
## Markdown generation
To generate a Markdown page from a source file, the plugin will:
- Cleanup the HTML output (with [BeautifulSoup](https://pypi.org/project/beautifulsoup4/))
- Convert it back to Markdown (with [Markdownify](https://pypi.org/project/markdownify))
Doing so is necessary to ensure that dynamically generated contents (API documentation, executed code blocks, snippets from other files, Jinja macros, etc.) are part of the generated text files.
Credits to [Petyo Ivanov](https://github.com/petyosi) for the original idea ✨.
You can disable auto-cleaning of the HTML:
```yaml title="mkdocs.yml"
plugins:
- llmstxt:
autoclean: false
```
You can also pre-process the HTML before it is converted back to Markdown:
```yaml title="mkdocs.yml"
plugins:
- llmstxt:
preprocess: path/to/script.py
```
The specified `script.py` must expose a `preprocess` function that accepts the `soup` and `output` arguments:
```python
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from bs4 import BeautifulSoup
def preprocess(soup: BeautifulSoup, output: str) -> None:
... # modify the soup
```
The `output` argument lets you modify the soup *depending on which file is being generated*.
Have a look at [our own cleaning function](https://pawamoy.github.io/mkdocs-llmstxt/reference/api/#mkdocs_llmstxt.autoclean) to get inspiration.
Raw data
{
"_id": null,
"home_page": null,
"name": "mkdocs-llmstxt",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "=?utf-8?q?Timoth=C3=A9e_Mazzucotelli?= <dev@pawamoy.fr>",
"download_url": "https://files.pythonhosted.org/packages/16/c2/a394c26eeb3e967877662748844f032c289688bac71d3b11e1f5e5d99dbb/mkdocs_llmstxt-0.3.1.tar.gz",
"platform": null,
"description": "# mkdocs-llmstxt\n\n[](https://github.com/pawamoy/mkdocs-llmstxt/actions?query=workflow%3Aci)\n[](https://pawamoy.github.io/mkdocs-llmstxt/)\n[](https://pypi.org/project/mkdocs-llmstxt/)\n[](https://app.gitter.im/#/room/#mkdocs-llmstxt:gitter.im)\n\nMkDocs plugin to generate an [/llms.txt file](https://llmstxt.org/).\n\n> /llms.txt - A proposal to standardise on using an /llms.txt file to provide information to help LLMs use a website at inference time.\n\nSee our own dynamically generated [/llms.txt](https://pawamoy.github.io/mkdocs-llmstxt/llms.txt) as a demonstration.\n\n## Installation\n\n```bash\npip install mkdocs-llmstxt\n```\n\n## Usage\n\nEnable the plugin in `mkdocs.yml`:\n\n```yaml title=\"mkdocs.yml\"\nsite_name: My project\nsite_description: Description of my project.\nsite_url: https://myproject.com/ # Required for the llmstxt plugin to work.\n\nplugins:\n- llmstxt:\n markdown_description: Long description of my project.\n sections:\n Usage documentation:\n - file1.md: Description of file1\n - file2.md # Descriptions are optional.\n```\n\nThe resulting `/llms.txt` file will be available at the root of your documentation. With the previous example, it will be accessible at https://myproject.com/llms.txt and will contain the following:\n\n```markdown\n# My project\n\n> Description of my project.\n\nLong description of my project.\n\n## Usage documentation\n\n- [File1 title](https://myproject.com/file1.md): Description of file1\n- [File2 title](https://myproject.com/file2.md)\n```\n\nEach source file included in `sections` will have its own Markdown file available at the specified URL in the `/llms.txt`. See [Markdown generation](#markdown-generation) for more details.\n\nFile globbing is supported:\n\n```yaml title=\"mkdocs.yml\"\nplugins:\n- llmstxt:\n sections:\n Usage documentation:\n - index.md: Main documentation page\n - usage/*.md\n```\n\n## Full output\n\nAlthough not explicitly written out in the https://llmstxt.org/ guidelines, it is common to output a `llms-full.txt` file with every page content expanded. This file can be generated by setting the `full_output` configuration value:\n\n```yaml title=\"mkdocs.yml\"\nplugins:\n- llmstxt:\n full_output: llms-full.txt\n sections:\n Usage documentation:\n - index.md\n - usage/*.md\n```\n\n## Markdown generation\n\nTo generate a Markdown page from a source file, the plugin will:\n\n- Cleanup the HTML output (with [BeautifulSoup](https://pypi.org/project/beautifulsoup4/))\n- Convert it back to Markdown (with [Markdownify](https://pypi.org/project/markdownify))\n\nDoing so is necessary to ensure that dynamically generated contents (API documentation, executed code blocks, snippets from other files, Jinja macros, etc.) are part of the generated text files.\n\nCredits to [Petyo Ivanov](https://github.com/petyosi) for the original idea \u2728.\n\nYou can disable auto-cleaning of the HTML:\n\n```yaml title=\"mkdocs.yml\"\nplugins:\n- llmstxt:\n autoclean: false\n```\n\nYou can also pre-process the HTML before it is converted back to Markdown:\n\n```yaml title=\"mkdocs.yml\"\nplugins:\n- llmstxt:\n preprocess: path/to/script.py\n```\n\nThe specified `script.py` must expose a `preprocess` function that accepts the `soup` and `output` arguments:\n\n```python\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n from bs4 import BeautifulSoup\n\ndef preprocess(soup: BeautifulSoup, output: str) -> None:\n ... # modify the soup\n```\n\nThe `output` argument lets you modify the soup *depending on which file is being generated*.\n\nHave a look at [our own cleaning function](https://pawamoy.github.io/mkdocs-llmstxt/reference/api/#mkdocs_llmstxt.autoclean) to get inspiration.\n",
"bugtrack_url": null,
"license": null,
"summary": "MkDocs plugin to generate an /llms.txt file.",
"version": "0.3.1",
"project_urls": {
"Changelog": "https://pawamoy.github.io/mkdocs-llmstxt/changelog",
"Discussions": "https://github.com/pawamoy/mkdocs-llmstxt/discussions",
"Documentation": "https://pawamoy.github.io/mkdocs-llmstxt",
"Funding": "https://github.com/sponsors/pawamoy",
"Gitter": "https://gitter.im/mkdocs-llmstxt/community",
"Homepage": "https://pawamoy.github.io/mkdocs-llmstxt",
"Issues": "https://github.com/pawamoy/mkdocs-llmstxt/issues",
"Repository": "https://github.com/pawamoy/mkdocs-llmstxt"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "b07752514b44c8e73e0a81883270ab6d3e64be7a6f62f54783719437e847a50e",
"md5": "03d7552f48d350088ec3ae270fba2d43",
"sha256": "31f5b6aaae6123c09a2b1c32912c3eb21ccb356b5db7abb867f105e8cc392653"
},
"downloads": -1,
"filename": "mkdocs_llmstxt-0.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "03d7552f48d350088ec3ae270fba2d43",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 11175,
"upload_time": "2025-08-05T13:42:40",
"upload_time_iso_8601": "2025-08-05T13:42:40.436333Z",
"url": "https://files.pythonhosted.org/packages/b0/77/52514b44c8e73e0a81883270ab6d3e64be7a6f62f54783719437e847a50e/mkdocs_llmstxt-0.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "16c2a394c26eeb3e967877662748844f032c289688bac71d3b11e1f5e5d99dbb",
"md5": "22643d6b4237eaa2cbe431823a9b91a4",
"sha256": "123119d9b984c1d1224ed5af250bfbc49879ad83decdaff59d8b0ebb459ddc54"
},
"downloads": -1,
"filename": "mkdocs_llmstxt-0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "22643d6b4237eaa2cbe431823a9b91a4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 31329,
"upload_time": "2025-08-05T13:42:41",
"upload_time_iso_8601": "2025-08-05T13:42:41.412560Z",
"url": "https://files.pythonhosted.org/packages/16/c2/a394c26eeb3e967877662748844f032c289688bac71d3b11e1f5e5d99dbb/mkdocs_llmstxt-0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-05 13:42:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pawamoy",
"github_project": "mkdocs-llmstxt",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "mkdocs-llmstxt"
}