all2md.options.odt
Configuration options for ODT (OpenDocument Text) parsing and rendering.
This module defines options for parsing and rendering ODT document files.
- class all2md.options.odt.OdtOptions
Bases:
BaseParserOptions,AttachmentOptionsMixinConfiguration options for ODT-to-Markdown conversion.
This dataclass contains settings specific to OpenDocument Text (ODT) processing. Inherits attachment handling from AttachmentOptionsMixin for embedded images.
- Parameters:
preserve_tables (bool, default True) – Whether to preserve table formatting in Markdown.
- preserve_tables: bool = True
- __init__(attachment_mode: AttachmentMode = 'alt_text', alt_text_mode: AltTextMode = 'default', attachment_output_dir: str | None = None, attachment_base_url: str | None = None, max_asset_size_bytes: int = 52428800, attachment_filename_template: str = '{stem}_{type}{seq}.{ext}', attachment_overwrite: AttachmentOverwriteMode = 'unique', attachment_deduplicate_by_hash: bool = False, attachments_footnotes_section: str | None = 'Attachments', extract_metadata: bool = False, preserve_tables: bool = True) None
- class all2md.options.odt.OdtRendererOptions
Bases:
BaseRendererOptionsConfiguration options for rendering AST to ODT format.
This dataclass contains settings specific to OpenDocument Text generation, including fonts, styles, and formatting preferences.
- Parameters:
default_font (str, default "Liberation Sans") – Default font name for body text.
default_font_size (int, default 11) – Default font size in points for body text.
heading_font_sizes (dict[int, int] or None, default None) – Font sizes for heading levels 1-6. If None, uses built-in ODT heading styles.
use_styles (bool, default True) – Whether to use built-in ODT styles vs direct formatting.
code_font (str, default "Liberation Mono") – Font name for code blocks and inline code.
code_font_size (int, default 10) – Font size for code blocks and inline code.
preserve_formatting (bool, default True) – Whether to preserve text formatting (bold, italic, etc.).
template_path (str or None, default None) – Path to .odt template file. When specified, the renderer uses the template’s styles instead of creating a blank document.
network (NetworkFetchOptions, default NetworkFetchOptions()) – Network security settings for fetching remote images.
comment_mode ({"native", "visible", "ignore"}, default "native") – How to render Comment and CommentInline AST nodes: - “native”: Use odfpy native comment/annotation support (preserves ODT comments when possible) - “visible”: Render as regular text paragraphs with attribution - “ignore”: Skip comment nodes entirely This controls presentation of comments from ODT source files and other formats.
- default_font: str = 'Liberation Sans'
- default_font_size: int = 11
- heading_font_sizes: dict[int, int] | None = None
- use_styles: bool = True
- code_font: str = 'Liberation Mono'
- code_font_size: int = 10
- preserve_formatting: bool = True
- template_path: str | None = None
- network: NetworkFetchOptions
- comment_mode: Literal['native', 'visible', 'ignore'] = 'native'
- __init__(fail_on_resource_errors: bool = False, max_asset_size_bytes: int = 52428800, metadata_policy: MetadataRenderPolicy = <factory>, creator: str | None = 'all2md', default_font: str = 'Liberation Sans', default_font_size: int = 11, heading_font_sizes: dict[int, int] | None=None, use_styles: bool = True, code_font: str = 'Liberation Mono', code_font_size: int = 10, preserve_formatting: bool = True, template_path: str | None = None, network: NetworkFetchOptions = <factory>, comment_mode: OdtCommentMode = 'native') None