all2md.parsers.odp

ODP (OpenDocument Presentation) to AST converter.

This module provides conversion from ODP presentation files to AST representation. It replaces the combined ODF parser with a focused presentation parser.

class all2md.parsers.odp.OdpToAstConverter

Bases: BaseParser

Convert ODP presentation files to AST representation.

This converter processes ODP (OpenDocument Presentation) files and builds an AST that can be rendered to various markdown flavors.

Parameters:

options (OdpOptions or None) – Conversion options

Initialize the ODP parser with options and progress callback.

__init__(options: OdpOptions | None = None, progress_callback: Callable[[ProgressEvent], None] | None = None)

Initialize the ODP parser with options and progress callback.

parse(input_data: str | Path | IO[bytes] | bytes) Document

Parse ODP document into an AST.

Parameters:

input_data (str, Path, IO[bytes], or bytes) – The input ODP document to parse

Returns:

AST Document node representing the parsed presentation structure

Return type:

Document

Raises:
convert_to_ast(doc: odf.opendocument.OpenDocument) Document

Convert ODP document to AST Document.

Returns:

AST document node

Return type:

Document

extract_metadata(document: Any) DocumentMetadata

Extract metadata from ODP document.

Parameters:

document (opendocument.OpenDocument) – ODP document object from odfpy

Returns:

Extracted metadata

Return type:

DocumentMetadata