page¶
Confluence Page Data Model
Provides the Page class for representing Confluence pages with hierarchy metadata and serialization to XML/Markdown for AI knowledge base export.
- class docpack_confluence.page.Page(site_url: str, entity: Entity, result: GetPagesResponseResult)[source]¶
Confluence page with hierarchy metadata and serialization capabilities.
Combines crawled entity data (hierarchy info) with fetched page content (from Confluence API) to provide a complete page representation for export.
- Parameters:
site_url – Base URL of the Confluence site (e.g., “https://example.atlassian.net”)
entity – Crawled entity containing hierarchy metadata (breadcrumb paths, etc.)
result – Page content from Confluence get_pages API response
The page body is expected in Atlas Doc Format which is converted to Markdown for export.
- to_markdown(ignore_error: bool = True) str[source]¶
Convert page content to Markdown format.
- Parameters:
ignore_error – Skip unsupported content types instead of raising errors
- Returns:
Markdown string with page title as H1 header
- to_xml(wanted_fields: Set[ConfluencePageFieldEnum] | None = None, to_markdown_ignore_error: bool = True) str[source]¶
Serialize page to XML format for AI knowledge base ingestion.
- Parameters:
wanted_fields – Fields to include; None means all fields
to_markdown_ignore_error – Skip errors during markdown conversion
- Returns:
XML string with document structure