MkDocs LLMstxt Plugin

0.5.0 · maintenance · verified Thu Apr 16

MkDocs plugin to generate an `/llms.txt` file, a standard for providing LLM-friendly content summaries and links from websites. It automatically processes your MkDocs documentation during the build process, creating a concise index of content accessible to AI language models. The plugin can also generate a `/llms-full.txt` file with concatenated content and per-page Markdown files. The project is currently in maintenance mode.

Common errors

Warnings

Install

Quickstart

This quickstart guides you through setting up a new MkDocs project, configuring the `mkdocs-llmstxt` plugin, creating some sample documentation, and building the site to generate the `/llms.txt` file. The `site_url` configuration option is crucial for correct link generation. After building, `llms.txt` will be available in your `site` directory, along with Markdown versions of your pages if configured.

mkdir my-llm-docs
cd my-llm-docs

# Create a minimal MkDocs config
cat <<EOF > mkdocs.yml
site_name: My LLM Project
site_url: https://example.com/ # REQUIRED for llmstxt plugin
site_description: A concise description of my project for LLMs.
plugins:
  - llmstxt:
      markdown_description: >
        This is a longer, more detailed description of the project.
        It provides additional context for AI models.
      sections:
        Introduction:
          - index.md: Key concepts and overview
        Guides:
          - guides/*.md # Glob patterns are supported
        API Reference:
          - api/reference.md
EOF

# Create some example documentation files
mkdir docs docs/guides docs/api
cat <<EOF > docs/index.md
# Welcome to My LLM Project

This is the main introduction to our project.
EOF

cat <<EOF > docs/guides/setup.md
# Setup Guide

Follow these steps to set up the project.
EOF

cat <<EOF > docs/api/reference.md
# API Reference

Details about the API endpoints.
EOF

# Build the documentation, which generates llms.txt
mkdocs build

echo "\nCheck the 'site' directory for llms.txt and the generated Markdown files."
# To serve locally:
# mkdocs serve

view raw JSON →