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:
BaseParserConvert 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:
- Raises:
ParsingError – If parsing fails due to invalid format or corruption
DependencyError – If required dependencies are not installed
- convert_to_ast(doc: odf.opendocument.OpenDocument) Document
Convert ODP document to AST Document.
- Returns:
AST document node
- Return type:
- extract_metadata(document: Any) DocumentMetadata
Extract metadata from ODP document.
- Parameters:
document (opendocument.OpenDocument) – ODP document object from odfpy
- Returns:
Extracted metadata
- Return type: