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 instanceCONFLUENCE_USERNAME
: Your Confluence usernameCONFLUENCE_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
- Initialization: The plugin connects to Confluence using the provided credentials.
- Page Creation: It creates a structure in Confluence mirroring your MkDocs navigation.
- Content Update: As it processes each page, it updates the content in Confluence.
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mkdocs_confluence_publisher-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a732048010de27795fcb371942d5430c65440847ee825b0d6f7904c8b23d4d5f |
|
MD5 | f459b1d397ddcde9054b843af80243d1 |
|
BLAKE2b-256 | 713517c0c6af5ee44bb5b650f9322b7104aecb860fbdffb0c9d1b1da2c733e05 |
Hashes for mkdocs_confluence_publisher-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 566fa1b3fb968649b60adff989517de7753f7074962d26a887735f13a1de49e9 |
|
MD5 | a8d4a077987f4bb850d3618a129ce901 |
|
BLAKE2b-256 | 0597fe4e6fb2b78a51fd123e1aca083ffd3b6b20522ff9be39c039735771be85 |