Skip to main content

A MkDocs plugin to publish documentation to Confluence

Project description

MkDocs Confluence Publisher Plugin

This MkDocs plugin automatically publishes your documentation to Confluence. It creates a hierarchical structure in Confluence that mirrors your MkDocs site structure, updates page content, and handles attachments.

Features

  • Automatically creates and updates pages in Confluence
  • Maintains the hierarchy of your MkDocs site in Confluence
  • Handles attachments referenced in your markdown files
  • Configurable page prefix for easy identification in Confluence

Installation

Install the plugin using pip:

pip install mkdocs-confluence-publisher

Configuration

Add the following to your mkdocs.yml:

plugins:
  - confluence-publisher:
      confluence_prefix: "MkDocs - "  # Optional: Prefix for page titles in Confluence
      space_key: "YOUR_SPACE_KEY"     # Required: Confluence space key
      parent_page_id: 123456          # Required: ID of the parent page in Confluence

Environment Variables

The plugin requires the following environment variables to be set:

  • CONFLUENCE_URL: The base URL of your Confluence instance
  • CONFLUENCE_USERNAME: Your Confluence username
  • CONFLUENCE_API_TOKEN: Your Confluence API token

You can set these in your environment or use a .env file.

Usage

Once configured, the plugin will automatically publish your documentation to Confluence when you build your MkDocs site:

mkdocs build

How It Works

  1. Initialization: The plugin connects to Confluence using the provided credentials.
  2. Page Creation: It creates a structure in Confluence mirroring your MkDocs navigation.
  3. Content Update: As it processes each page, it updates the content in Confluence.
  4. Attachment Handling: Any attachments referenced in your markdown are uploaded to the corresponding Confluence page.

Logging

The plugin uses Python's logging module. You can configure logging in your mkdocs.yml:

logging:
  level: INFO

Set to DEBUG for more detailed logging information.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.

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_confluence_publisher-0.1.1.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file mkdocs_confluence_publisher-0.1.1.tar.gz.

File metadata

File hashes

Hashes for mkdocs_confluence_publisher-0.1.1.tar.gz
Algorithm Hash digest
SHA256 67df4068da5d8d16764c813483521512e71ee524bb715cfd6eacb1109a51fb8a
MD5 283458230f2cc2b951822bde2c1c609c
BLAKE2b-256 7b328006bf3281864f87014bb84783fb13282bea95503f30552b9435b2660b54

See more details on using hashes here.

File details

Details for the file mkdocs_confluence_publisher-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_confluence_publisher-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4e6109e247da938ea3b43d45bbe38274e8ca60081ac044180071d933c3359ae2
MD5 dc45bed5d1f6727801fe4a789521d7f6
BLAKE2b-256 d84a1a90f80287e07fb64a013f9dde07ea7ef3cdb1635b2d96dedad1f5ac7587

See more details on using hashes here.

Supported by

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