Core API
The core API provides the main entry points for document conversion. These functions handle format detection, parsing, transformation, and rendering in a unified interface.
Main Functions
The primary functions for document conversion:
|
Convert document to Markdown format with enhanced format detection. |
|
Convert document to AST (Abstract Syntax Tree) format. |
|
Render AST document to a target format. |
|
Convert Markdown content to another format. |
|
Convert between document formats. |
Quality scoring, for deciding how much to trust a conversion:
|
Convert a document and return its conversion confidence report ("quality card"). |
|
Round-trip a document through |
|
Return the formats that can be both rendered to and parsed back from. |
|
Search converter options for the settings that convert |
|
Return the formats |
For full function signatures and detailed documentation, see all2md.api.
Base Classes
Parser and renderer base classes define the interface that all format handlers implement:
Base class for all parser options. |
|
Base class for all renderer options. |
|
Abstract base class for all document parsers. |
|
Abstract base class for all AST renderers. |
Common Options
Shared option classes used across multiple formats for network and file access:
Network security options for remote resource fetching. |
|
Local file access security options. |
Exceptions
The exception hierarchy for handling conversion errors:
Base exception class for all all2md-specific errors. |
|
Exception raised for invalid input parameters or options. |
|
Base exception for file access and I/O errors. |
|
Exception raised when attempting to process an unsupported file format. |
|
Exception raised when document parsing fails. |
|
Exception raised when output rendering fails. |
|
Exception raised when AST transformation fails. |
|
Base exception for security violations. |
|
Exception raised when required dependencies are not available. |
Progress Reporting
Classes for tracking conversion progress:
Progress event for document conversion operations. |
|
Type alias for progress callback functions. |
Converter Registry
The registry system for format detection and converter lookup:
Registry for managing document parsers and renderers. |
|
Metadata describing a converter's capabilities and requirements. |