Skip to main content

mkdocs-to-confluence

PyPI Python Version License Downloads

A MkDocs plugin that automatically publishes your documentation to Atlassian Confluence. Convert Markdown pages to Confluence format and maintain synchronized documentation across platforms.


Full Documentation following Diataxis framework with :


Table of Contents

Features

Core Capabilities

  • Automated Publishing - Seamlessly publish MkDocs documentation to Confluence during builds
  • Unlimited Hierarchy Depth - Support for arbitrary nesting levels
  • Smart Updates - Creates new pages or updates existing ones based on title matching
  • Intelligent Update Detection - Compares content before updating to skip unnecessary changes, reducing version bumps
  • Orphaned Page Management - Automatically detects and optionally cleans up pages that no longer exist in your documentation, keeping your Confluence space in perfect sync
  • Image Management - Automatically uploads and updates images as attachments with SHA1 hash-based change detection

Authentication & Security

  • Multiple Authentication Methods - Supports Basic Auth, API tokens, and OAuth Bearer tokens
  • Environment Variable Support - Secure credential management for CI/CD pipelines

Developer Experience

  • Dry Run Mode - Export to filesystem for review before publishing to Confluence
  • Conditional Publishing - Enable/disable based on environment variables
  • Enhanced Markdown - Extended syntax support including strikethrough, admonitions, task lists, and more
  • Comprehensive Logging - Verbose and debug modes with detailed content comparison

Installation

Install from PyPI

The recommended way to install mkdocs-to-confluence is via pip:

pip install mkdocs-to-confluence

Or add to your requirements.txt:

mkdocs>=1.1
mkdocs-to-confluence

Quick Start

API Token

  1. Go to Atlassian Account Settings
  2. Click "Create API token"
  3. Give it a name and copy the token

Space Key

Find your Confluence space key:

  1. Go to your Confluence space
  2. Click "Space Settings"
  3. The space key is shown in the URL: https://your-domain.atlassian.net/wiki/spaces/SPACEKEY/

Configuration

Open your mkdocs.yml and add the plugin:

plugins:
  - search  # Keep your existing plugins
  - mkdocs-to-confluence:
      host_url: https://your-domain.atlassian.net/wiki/rest/api/content
      space: YOUR_SPACE
      parent_page_name: Documentation

Set up your Confluence credentials using environment variables (recommended):

export JIRA_USERNAME=your-email@example.com
export CONFLUENCE_API_TOKEN=your-api-token

!!! tip "Getting Your API Token" Generate an API token at Atlassian Account Settings

Alternatively, you can specify credentials directly in mkdocs.yml (not recommended for production):

plugins:
  - mkdocs-to-confluence:
      host_url: https://your-domain.atlassian.net/wiki/rest/api/content
      space: DOCS
      username: your-email@example.com
      api_token: your-token  # Better to use environment variable!

Orphaned Page Management

Keep your Confluence space in sync by automatically detecting and optionally cleaning up pages that no longer exist in your documentation:

plugins:
  - mkdocs-to-confluence:
      # ... other config ...
      cleanup_orphaned_pages: false  # Set to true to auto-delete orphaned pages
      keep_pages:  # Pages to preserve even if not in docs
        - "Archive"
        - "Manual Documentation"
      page_label: auto-generated-docs  # Label all synced pages for easy filtering

How it works:

  • Always warns about orphaned pages (pages in Confluence but not in your docs)
  • Optionally deletes them automatically when cleanup_orphaned_pages: true
  • Preserves pages listed in keep_pages to protect manual content
  • See Managing Orphaned Pages for detailed strategies

For complete configuration options, see the Configuration Reference.

Markdown Support

See the Markdown Showcase and full documentation.

Troubleshooting

Common Issues

For detailed troubleshooting, see the full documentation.

Quick fixes:

  • Authentication failed: Verify username and API token
  • Space not found: Check space key (case-sensitive)
  • Parent page not found: Create parent page in Confluence first
  • Images not uploading: Check image paths in Markdown

Debug mode:

plugins:
  - mkdocs-to-confluence:
      debug: true        # General debugging (API calls, operations)
      debug_diff: true   # Content comparison details (creates temp files)
      verbose: true

Dry run testing:

plugins:
  - mkdocs-to-confluence:
      dryrun: true
      export_dir: confluence-export

Requirements

  • Python: >=3.8
  • MkDocs: >=1.1
  • Dependencies: jinja2, requests, mistune>=3.1.2, mime>=0.1.0

Contributing

Contributions are welcome! See the Contributing Guide for details.

Quick start:

git clone https://github.com/jmanteau/mkdocs-to-confluence.git
cd mkdocs-to-confluence
make py-setup
make py-test

License

This project is licensed under the MIT License - see the LICENSE file for details.

Third-Party Licenses

This project includes a vendored copy of md2cf (MIT License), which has been modified to support mistune 3.x and additional Confluence features.

Acknowledgments

Support


This README is auto-generated from documentation sources. Do not edit directly. To update, modify the docs and run make readme

Metadata

Release files for mkdocs-to-confluence 0.6.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-to-confluence 0.6.0
File Size Uploaded Provenance Actions
mkdocs_to_confluence-0.6.0.tar.gz 314.0 kB Without provenance Details for mkdocs_to_confluence-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mkdocs-to-confluence 0.6.0
File Interpreter ABI Platform Actions
mkdocs_to_confluence-0.6.0-py3-none-any.whl Python 3 none any Details for mkdocs_to_confluence-0.6.0-py3-none-any.whl

Total release size: 357.2 kB

Release files / mkdocs_to_confluence-0.6.0.tar.gz

Download URL mkdocs_to_confluence-0.6.0.tar.gz
Size 314.0 kB
Tags Source
SHA-256 checksum
How to use checksums
13dd12514ccab04c4adc076ff59220f9386ef0f7ab73319103e74a158d465539
BLAKE2b-256 checksum
How to use checksums
1793621ac2fa687fb30dd8ba791d4861cf860b662465136f83e94d9ce1bd4f4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.6

Release files / mkdocs_to_confluence-0.6.0-py3-none-any.whl

Download URL mkdocs_to_confluence-0.6.0-py3-none-any.whl
Size 43.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
749dc22cf28879477dcb4335b405bc25a598bf0d5828f9407d9d7a323f50228a
BLAKE2b-256 checksum
How to use checksums
edd54208fdc6a849b34b767750801d23f0fea08a4f89c3b5204ab29029d9dacb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.6

Security for mkdocs-to-confluence 0.6.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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