mkdocs_to_confluence.exporter¶
Export Confluence-formatted content to local filesystem in dry-run mode.
PageMetadata
dataclass
¶
PageMetadata(
title: str,
parent: str | None,
space: str,
attachments: list[str] = list(),
confluence_body: str = "",
)
Metadata for a Confluence page export.
Attributes:
| Name | Type | Description |
|---|---|---|
title |
str
|
Page title |
parent |
str | None
|
Direct parent page title |
space |
str
|
Confluence space key |
attachments |
list[str]
|
List of attachment file paths |
confluence_body |
str
|
The Confluence-formatted HTML content |
to_dict ¶
Convert metadata to dictionary for JSON serialization.
ConfluenceExporter ¶
Export Confluence-formatted pages to local filesystem.
Creates a hierarchical directory structure that mirrors the Confluence page hierarchy, making it easy to review content before actual upload.
Initialize exporter with target directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
export_dir
|
Path
|
Root directory for exported content |
required |
Source code in src/mkdocs_to_confluence/exporter.py
add_page ¶
add_page(
title: str,
parent: str | None,
space: str,
confluence_body: str,
attachments: list[str] | None = None,
) -> None
Add a page to the export queue.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
Page title |
required |
parent
|
str | None
|
Direct parent page title (None for root pages) |
required |
space
|
str
|
Confluence space key |
required |
confluence_body
|
str
|
The Confluence-formatted HTML content |
required |
attachments
|
list[str] | None
|
Optional list of attachment file paths |
None
|
Source code in src/mkdocs_to_confluence/exporter.py
export_all ¶
Export all queued pages to the filesystem.
Creates the complete directory structure and writes all pages, metadata, and attachments.