The confluence-markdown-exporter exports Confluence pages in Markdown format. This exporter helps in migrating content from Confluence to platforms that support Markdown e.g. Obsidian, Gollum, Azure DevOps, Foam, Dendron and more.
Features
- Converts Confluence pages to Markdown format.
- Uses the Atlassian API to export individual pages, pages including children, and whole spaces.
- Supports various Confluence elements such as headings, paragraphs, lists, tables, and more.
- Retains formatting such as bold, italic, and underline.
- Converts Confluence macros to equivalent Markdown syntax where possible.
- Handles images and attachments by linking them appropriately in the Markdown output.
- Supports extended Markdown features like tasks, alerts, and front matter.
Supported Markdown Elements
- Headings: Converts Confluence headings to Markdown headings.
- Paragraphs: Converts Confluence paragraphs to Markdown paragraphs.
- Lists: Supports both ordered and unordered lists.
- Tables: Converts Confluence tables to Markdown tables.
- Formatting: Supports bold, italic, and underline text.
- Links: Converts Confluence links to Markdown links.
- Images: Converts Confluence images to Markdown images with appropriate links.
- Code Blocks: Converts Confluence code blocks to Markdown code blocks.
- Tasks: Converts Confluence tasks to Markdown task lists.
- Alerts: Converts Confluence info panels to Markdown alert blocks.
- Front Matter: Adds front matter to the Markdown files for metadata like page properties and page labels.
Usage
To use the confluence-markdown-exporter, follow these steps:
1. Installation
Install python package via pip.
pip install confluence-markdown-exporter-advanced
2. Configure Authentication
You must set environment variables for one of the following authentication options:
-
Username + API Token
ATLASSIAN_USERNAME: Your Atlassian account email addressATLASSIAN_API_TOKEN: An API token created at
https://id.atlassian.com/manage-profile/security/api-tokens
-
Personal Access Token (PAT)
ATLASSIAN_PAT: A Personal Access Token (used instead of username+token)
In all cases, you must also set:
ATLASSIAN_URL: Your Atlassian instance URL (e.g.https://company.atlassian.net)
Here an example setting the environment variables for the Username + API Token authentication for the current terminal session.
export ATLASSIAN_USERNAME="work mail address"
export ATLASSIAN_API_TOKEN="API token Test"
export ATLASSIAN_URL="https://company.atlassian.net"
3. Exporting
Run the exporter with the desired Confluence page ID/URL or space key.
Export a single Confluence page by URL:
confluence-markdown-exporter page-url <page-url e.g. https://company.atlassian.net/Wiki/foo/bar> <output path e.g. ./output_path/>
Export a single Confluence page by id:
confluence-markdown-exporter page-id <page-id e.g. 645208921> <output path e.g. ./output_path/>
Export a Confluence page and all it's descendants:
confluence-markdown-exporter page-with-descendants <page-id e.g. 645208921> <output path e.g. ./output_path/>
Export all Confluence pages of a single Space:
confluence-markdown-exporter space <space-key e.g. MYSPACE> <output path e.g. ./output_path/>
Export all Confluence pages across all spaces:
confluence-markdown-exporter all-spaces <output path e.g. ./output_path/>
4. Output
The exported Markdown file(s) will be saved in the specified output directory e.g.:
output_path/
└── MYSPACE/
├── MYSPACE.md
└── MYSPACE/
├── My Confluence Page.md
└── My Confluence Page/
├── My nested Confluence Page.md
└── Another one.md
Configuration Options
By default the converter uses a GitHub Flavored Markdown (GFM). You can also choose an Obsidian flavored markdown by setting:
export MARKDOWN_STYLE="Obsidian"
Via PAGE_PATH and ATTACHMENT_PATH you can customize how pages and attachments are organized in the output directory.
By default, pages are stored at:
export PAGE_PATH="{space_name}/{homepage_title}/{ancestor_titles}/{page_title}.md"
Available variables:
{space_key}: The key of the Confluence space.{space_name}: The name of the Confluence space.{homepage_id}: The ID of the homepage of the Confluence space.{homepage_title}: The title of the homepage of the Confluence space.{ancestor_ids}: A slash-separated list of ancestor page IDs.{ancestor_titles}: A slash-separated list of ancestor page titles.{page_id}: The unique ID of the Confluence page.{page_title}: The title of the Confluence page.
By default, attachments are stored at:
export ATTACHMENT_PATH="{space_name}/attachments/{attachment_file_id}{attachment_extension}"
Available variables:
{space_key}: The key of the Confluence space.{space_name}: The name of the Confluence space.{homepage_id}: The ID of the homepage of the Confluence space.{homepage_title}: The title of the homepage of the Confluence space.{ancestor_ids}: A slash-separated list of ancestor page IDs.{ancestor_titles}: A slash-separated list of ancestor page titles.{attachment_id}: The unique ID of the attachment.{attachment_title}: The title of the attachment.{attachment_file_id}: The file ID of the attachment.{attachment_extension}: The file extension of the attachment, including the leading dot.
Contributing
If you would like to contribute, please read our contribution guideline.
License
This tool is an open source project released under the MIT License.
Metadata
Release files for confluence-markdown-exporter-advanced 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| confluence_markdown_exporter_advanced-0.5.0.tar.gz | 81.4 kB | Without provenance | Details for confluence_markdown_exporter_advanced-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| confluence_markdown_exporter_advanced-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for confluence_markdown_exporter_advanced-0.5.0-py3-none-any.whl |
Total release size: 100.9 kB
Release files / confluence_markdown_exporter_advanced-0.5.0.tar.gz
| Download URL | confluence_markdown_exporter_advanced-0.5.0.tar.gz |
|---|---|
| Size | 81.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0f5303399f37952533f1ef9aff3f6086a476b3e3afd900ee37d679a7e338828e
|
|
BLAKE2b-256 checksum How to use checksums |
5a76ad8dd41c8d1457aa14ab87bc6e8a00b309d1e4d31fb35539b55c23e74064
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.5
|
Release files / confluence_markdown_exporter_advanced-0.5.0-py3-none-any.whl
| Download URL | confluence_markdown_exporter_advanced-0.5.0-py3-none-any.whl |
|---|---|
| Size | 19.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b7fac5c324cb849a4258edc57951c0f7e037d4780ddd5de417bc9f188599352b
|
|
BLAKE2b-256 checksum How to use checksums |
4492c0c244d2705904b4dbb2496fde82b038d0f9cb1ffa891ea09d9a38876e0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.5
|
Security for confluence-markdown-exporter-advanced 0.5.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.