Skip to main content

MkDocs Copy Markdown

An MkDocs plugin that adds a "Copy as Markdown" button to every rendered documentation page, making it easy to copy content for pasting into AI assistants or sharing with others.

Features

  • Adds a customizable "Copy as Markdown" button to every page
  • Works with both modern browsers (using Clipboard API) and legacy browsers (fallback method)
  • Configurable button text and position
  • Visual feedback when copying succeeds or fails
  • No external dependencies beyond MkDocs

Installation

Install the plugin using pip:

pip install mkdocs-copy-markdown

Or install from source:

git clone https://github.com/ndrezn/mkdocs-copy-markdown.git
cd mkdocs-copy-markdown
pip install .

Configuration

Add the plugin to your mkdocs.yml configuration file:

plugins:
  - copy-markdown

Options

You can customize the plugin behavior with these options:

plugins:
  - copy-markdown:
      button_text: "Copy as Markdown"  # Text displayed on the button
      button_position: "top"           # Position: "top" or "bottom"

Configuration Options

  • button_text (default: "Copy as Markdown"): The text displayed on the copy button
  • button_position (default: "top"): Where to place the button relative to page content. Options are:
    • "top": Places the button above the page content
    • "bottom": Places the button below the page content

Usage

Once installed and configured, the plugin will automatically add a copy button to every page in your MkDocs site. Users can click the button to copy the original markdown source of the page to their clipboard.

The button includes visual feedback:

  • ✓ Copied! - Success message in green
  • ✗ Copy failed - Error message in red

Browser Compatibility

The plugin uses the modern Clipboard API when available and falls back to the legacy document.execCommand('copy') method for older browsers, ensuring broad compatibility.

Development

To set up for development:

git clone https://github.com/ndrezn/mkdocs-copy-markdown.git
cd mkdocs-copy-markdown
pip install -e .

License

This project is licensed under the MIT License.

Release files for mkdocs-copy-markdown 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mkdocs-copy-markdown 0.1.0
File Size Uploaded
mkdocs_copy_markdown-0.1.0.tar.gz 10.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mkdocs-copy-markdown 0.1.0
File Interpreter ABI Platform
mkdocs_copy_markdown-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.1 kB

Release files / mkdocs_copy_markdown-0.1.0.tar.gz

Download URL mkdocs_copy_markdown-0.1.0.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7b9b68b80b3cbd7ba771f4d90e2835bd56fabc0afa18530dbf7e2b963754d3de
BLAKE2b-256 checksum
How to use checksums
f9491c4a7cd002f33b00b940648732f05996555cdd21d15abf02a3be053fa96e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2025.

Transparency log

Release files / mkdocs_copy_markdown-0.1.0-py3-none-any.whl

Download URL mkdocs_copy_markdown-0.1.0-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c4ae168ecda7fdc5ad7717a608b1629576cca7cbb6a1902661341414d3f48912
BLAKE2b-256 checksum
How to use checksums
46875e4e680d8aca3bc82571f515c3c82d62d4fabe155677287079314b0995e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 29, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page