Skip to main content

MkDocs plugin to add 'Copy to LLM' buttons to documentation

Project description

MkDocs Copy to LLM Plugin

A MkDocs plugin that adds "Copy to LLM" buttons to your documentation, making it easy to copy code blocks and entire pages in formats optimized for Large Language Models (LLMs).

Features

  • Copy to LLM buttons for code blocks - Adds a button next to each code block to copy the code with context
  • Copy entire page - Adds a split button at the top of each page with multiple copy options:
    • Copy page content as markdown
    • Copy markdown link
    • Open in ChatGPT
    • Open in Claude
    • View raw markdown
  • Smart formatting - Automatically formats content with proper context for LLM consumption
  • Visual feedback - Shows success indicators and toast notifications
  • Mobile responsive - Works seamlessly on all device sizes

Installation

Install the plugin using pip:

pip install mkdocs-copy-to-llm

Configuration

Add the plugin to your mkdocs.yml:

plugins:
  - search
  - copy-to-llm

Options

The plugin supports the following configuration options:

plugins:
  - copy-to-llm:
      enabled: true  # Enable/disable the plugin (default: true)
      code_blocks: true  # Add buttons to code blocks (default: true)
      page_button: true  # Add button to page headers (default: true)

How It Works

The plugin automatically:

  1. Injects the necessary JavaScript and CSS files
  2. Adds copy buttons to code blocks
  3. Adds a split button to the main page title
  4. Handles all copy operations with proper formatting

Customization

The plugin uses CSS variables from your MkDocs theme. It integrates seamlessly with Material for MkDocs theme.

License

Apache License 2.0

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_copy_to_llm-0.1.0.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

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

mkdocs_copy_to_llm-0.1.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_copy_to_llm-0.1.0.tar.gz.

File metadata

  • Download URL: mkdocs_copy_to_llm-0.1.0.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mkdocs_copy_to_llm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c3285bc4f3dc2002b52cebe56ff3111b9dadb8e0d41eac3f628bab676bc9915c
MD5 444328097cb44c58c9065be8689dda22
BLAKE2b-256 ebcc665388dff1f2caf01711c60d6d75c704a54dc1598d94d5b968ecd56c1605

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_copy_to_llm-0.1.0.tar.gz:

Publisher: release.yml on leonardocustodio/mkdocs-copy-to-llm

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_copy_to_llm-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_copy_to_llm-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94c5aad58049a1cbc2fe1e7765bbe33dc1d656db3e6e2c2330d8cd19c144e49f
MD5 69bdbf68e213f1b607febb0c58a40685
BLAKE2b-256 88fadd9f9cdf67c5349df11f74876df40e212c76c9524a5a65084e74600ca987

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_copy_to_llm-0.1.0-py3-none-any.whl:

Publisher: release.yml on leonardocustodio/mkdocs-copy-to-llm

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