MkDocs plugin for LLM-friendly documentation with direct markdown serving
Project description
mkdocs-llmstxt-md
MkDocs plugin for LLM-friendly documentation that provides:
- Direct markdown serving - Access original markdown at
page.mdURLs - llms.txt generation - Concise index file for LLM context
- llms-full.txt generation - Complete documentation in single file
- Copy-to-markdown button - Easy copying of source markdown
Features
- 🚀 Source-first approach - Works with original markdown, no HTML parsing
- 🤖 LLM optimized - Token-efficient formats for AI consumption
- 📋 Copy button - One-click markdown copying for developers
- 🔗 Dual URLs - Both human-readable HTML and LLM-friendly markdown
This plugin is inspired by mkdocs-llmstxt, the key difference is that mkdocs-llmstxt take the parsing HTML approach which can be used with injected HTML. This plugin focus on the raw markdown approach, which makes things simpler if you only need to work with markdown content.
Installation
uv add mkdocs-llmstxt-md
# or with pip
pip install mkdocs-llmstxt-md
Usage
Add to your mkdocs.yml:
plugins:
- llms-txt:
sections:
"Getting Started":
- index.md: "Introduction to the project"
- quickstart.md
"API Reference":
- api/*.md
Configuration
sections: Dict of section names to file patternsenable_markdown_urls: Enable .md URL serving (default: true)enable_llms_txt: Generate llms.txt (default: true)enable_llms_full: Generate llms-full.txt (default: true)enable_copy_button: Add copy button to pages (default: true)
Developer Setup
Prerequisites
- Python 3.8+
- uv (recommended) or pip
Installation for Development
-
Clone the repository:
git clone <repository-url> cd mkdocs-llmstxt-md
-
Install in development mode:
uv pip install -e . # or with pip pip install -e .
-
Verify installation:
uv pip list | grep mkdocs-llmstxt-md # or with pip pip list | grep mkdocs-llmstxt-md
Testing with the Test Site
The project includes a complete test site in test-site/ to validate all plugin features:
-
Build the test site:
cd test-site mkdocs build
-
Serve the test site locally:
mkdocs serveVisit http://localhost:8000 to see the documentation
-
Validate generated files: After building, check the
test-site/site/directory for:llms.txt- Index file with markdown URLsllms-full.txt- Complete documentation*.mdfiles alongside HTML pages (e.g.,index.md,quickstart/index.md)- Copy button on each page (top-right corner)
-
Test markdown URL access:
- Visit http://localhost:8000/index.md to see raw markdown
- Visit http://localhost:8000/quickstart/index.md for quickstart markdown
- Compare with HTML versions at http://localhost:8000/ and http://localhost:8000/quickstart/
Test Site Structure
The test site demonstrates all plugin features:
test-site/
├── mkdocs.yml # Plugin configuration example
└── docs/
├── index.md # Homepage with tables and code
├── quickstart.md # Getting started guide
├── installation.md # Detailed setup instructions
├── api/
│ ├── overview.md # API documentation
│ └── functions.md# Function reference
└── advanced/
└── configuration.md # Advanced config examples
Running Tests
Currently manual testing via the test site. Future versions will include automated tests.
Making Changes
- Modify code in
src/mkdocs_llms_txt/ - Test changes:
cd test-site && mkdocs build - Validate all features work as expected
- Check generated files in
test-site/site/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkdocs_llmstxt_md-0.1.0.tar.gz.
File metadata
- Download URL: mkdocs_llmstxt_md-0.1.0.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3282c3709bd55a208a3f78f646953d4123172b2c93b7e9624b012c252794ce1f
|
|
| MD5 |
f9e15c66945197f55ddf8994f04fe781
|
|
| BLAKE2b-256 |
a63e2dc43e7a77d2cc9868a700fdda6898433416568312b77450d018dac01ca2
|
Provenance
The following attestation bundles were made for mkdocs_llmstxt_md-0.1.0.tar.gz:
Publisher:
release.yml on noklam/mkdocs-llmstxt-md
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkdocs_llmstxt_md-0.1.0.tar.gz -
Subject digest:
3282c3709bd55a208a3f78f646953d4123172b2c93b7e9624b012c252794ce1f - Sigstore transparency entry: 336077955
- Sigstore integration time:
-
Permalink:
noklam/mkdocs-llmstxt-md@931779f4cd0b57c401b56ac3b7a252e9447a515b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/noklam
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@931779f4cd0b57c401b56ac3b7a252e9447a515b -
Trigger Event:
push
-
Statement type:
File details
Details for the file mkdocs_llmstxt_md-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mkdocs_llmstxt_md-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76501d0c4c3a8b03c81b626187cae8f7c646bd66e33791a260c0dde4f65b9efb
|
|
| MD5 |
4277a8f8ebda3122b270e946a2608491
|
|
| BLAKE2b-256 |
36c7fd44730ef4cd0e3da26df49e12baac02813c03aac968ffe04134f61c9ddf
|
Provenance
The following attestation bundles were made for mkdocs_llmstxt_md-0.1.0-py3-none-any.whl:
Publisher:
release.yml on noklam/mkdocs-llmstxt-md
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkdocs_llmstxt_md-0.1.0-py3-none-any.whl -
Subject digest:
76501d0c4c3a8b03c81b626187cae8f7c646bd66e33791a260c0dde4f65b9efb - Sigstore transparency entry: 336077969
- Sigstore integration time:
-
Permalink:
noklam/mkdocs-llmstxt-md@931779f4cd0b57c401b56ac3b7a252e9447a515b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/noklam
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@931779f4cd0b57c401b56ac3b7a252e9447a515b -
Trigger Event:
push
-
Statement type: