Skip to main content

MkDocs plugin for LLM-friendly documentation with direct markdown serving

Project description

mkdocs-llmstxt-md

MkDocs plugin for LLM-friendly documentation that provides:

  1. Direct markdown serving - Access original markdown at page.md URLs
  2. llms.txt generation - Concise index file for LLM context
  3. llms-full.txt generation - Complete documentation in single file
  4. 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 pip install 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 patterns
  • enable_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

  1. Clone the repository:

    git clone <repository-url>
    cd mkdocs-llmstxt-md
    
  2. Install in development mode:

    uv pip install -e .
    # or with pip
    pip install -e .
    
  3. 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:

  1. Build the test site:

    cd test-site
    mkdocs build
    
  2. Serve the test site locally:

    mkdocs serve
    

    Visit http://localhost:8000 to see the documentation

  3. Validate generated files: After building, check the test-site/site/ directory for:

    • llms.txt - Index file with markdown URLs
    • llms-full.txt - Complete documentation
    • *.md files alongside HTML pages (e.g., index.md, quickstart/index.md)
    • Copy button on each page (top-right corner)
  4. Test markdown URL access:

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

  1. Modify code in src/mkdocs_llmstxt_md/
  2. Test changes: cd test-site && mkdocs build
  3. Validate all features work as expected
  4. Check generated files in test-site/site/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs_llmstxt_md-0.2.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkdocs_llmstxt_md-0.2.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_llmstxt_md-0.2.0.tar.gz.

File metadata

  • Download URL: mkdocs_llmstxt_md-0.2.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

Hashes for mkdocs_llmstxt_md-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c42c86fc316c5e96920b403abfffda7615fe519baca9cdb716e9ff77b703570f
MD5 1ad57a2776f0de8839c223c8bc3263b9
BLAKE2b-256 be86a899ef021e44e358544b31fd3e34aa566ff876650e7dbede3e677053a492

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_llmstxt_md-0.2.0.tar.gz:

Publisher: release.yml on noklam/mkdocs-llmstxt-md

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mkdocs_llmstxt_md-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_llmstxt_md-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ce836a6e7bc7f7d0987c8ac0703f04b51f1d7d0096a5700b042161fbbaea5175
MD5 8e076705f8d47318a9bc62e1790ebe3f
BLAKE2b-256 4896519526b02a4429262b0e8728765a0bda8a987d1fd4e6ac7655f26ce2a245

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_llmstxt_md-0.2.0-py3-none-any.whl:

Publisher: release.yml on noklam/mkdocs-llmstxt-md

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page