all2md.options.rtf

Configuration options for RTF (Rich Text Format) parsing and rendering.

This module defines options for parsing RTF documents and rendering AST back into RTF using the pyth3 library.

class all2md.options.rtf.RtfRendererOptions

Bases: BaseRendererOptions

Configuration options for rendering AST documents to RTF.

Parameters:
  • font_family ({"roman", "swiss"}, default "roman") – Base font family to pass to pyth’s Rtf15Writer. The roman family maps to Times New Roman, while swiss maps to Calibri.

  • bold_headings (bool, default True) – When True, heading text is rendered with the RTF bold style to distinguish it from body paragraphs.

  • comment_mode ({"bracketed", "ignore"}, default "bracketed") – How to render Comment and CommentInline AST nodes: - “bracketed”: Render as [bracketed text] (default) - “ignore”: Skip comments entirely

font_family: Literal['roman', 'swiss'] = 'roman'
bold_headings: bool = True
comment_mode: Literal['bracketed', 'ignore'] = 'bracketed'
__init__(fail_on_resource_errors: bool = False, max_asset_size_bytes: int = 52428800, metadata_policy: MetadataRenderPolicy = <factory>, creator: str | None = 'all2md', font_family: RtfFontFamily = 'roman', bold_headings: bool = True, comment_mode: RtfCommentMode = 'bracketed') None
class all2md.options.rtf.RtfOptions

Bases: BaseParserOptions, AttachmentOptionsMixin

Configuration options for RTF-to-Markdown conversion.

This dataclass contains settings specific to Rich Text Format processing, including handling of embedded images and other attachments. Inherits attachment handling from AttachmentOptionsMixin.

Parameters:

AttachmentOptionsMixin (Inherited from BaseParserOptions and)

__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) None