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
confluence_suffix: " - MkDocs" # Optional: Suffix 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 Apache-2.0 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkdocs_confluence_publisher-0.2.0.tar.gz.
File metadata
- Download URL: mkdocs_confluence_publisher-0.2.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3633673a3cbb2feb2a9728d82245f9d5cbbb9f9694dca4a217e8f590a0aefa0b
|
|
| MD5 |
3847150644fc48b90047f7bab30f2bf0
|
|
| BLAKE2b-256 |
22d9e8d9a527b2a803218c8dc09313aa42acc75a48595bedccffd8a220572b5b
|
File details
Details for the file mkdocs_confluence_publisher-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mkdocs_confluence_publisher-0.2.0-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc952a50f1f7f6d78bae9b799b8a342f44dced44e50bb0c3455c230b35838eed
|
|
| MD5 |
6766b3ef11d1e3b9af847407cc0900bb
|
|
| BLAKE2b-256 |
57e02348d6aeaf1b84442605a482dbba1adeb94c60ec7d30715f37d85868db3f
|