all2md.options.ast_json

Options for AST JSON parsing and rendering.

This module provides configuration options for parsing and rendering documents in JSON-serialized AST format.

class all2md.options.ast_json.AstJsonParserOptions

Bases: BaseParserOptions

Options for parsing JSON AST documents.

Parameters:
  • validate_schema (bool, default = True) – Whether to validate the schema version during parsing

  • strict_mode (bool, default = False) – Whether to fail on unknown node types or attributes

validate_schema: bool = True
strict_mode: bool = False
__init__(extract_metadata: bool = False, validate_schema: bool = True, strict_mode: bool = False) None
class all2md.options.ast_json.AstJsonRendererOptions

Bases: BaseRendererOptions

Options for rendering documents to JSON AST format.

Parameters:
  • indent (int or None, default = 2) – Number of spaces for JSON indentation. None for compact output.

  • ensure_ascii (bool, default = False) – Whether to escape non-ASCII characters in JSON output

  • sort_keys (bool, default = False) – Whether to sort JSON object keys alphabetically

Examples

Compact JSON output:
>>> options = AstJsonRendererOptions(indent=None)
Pretty-printed JSON with sorted keys:
>>> options = AstJsonRendererOptions(indent=2, sort_keys=True)
ASCII-only output:
>>> options = AstJsonRendererOptions(ensure_ascii=True)
indent: int | None = 2
ensure_ascii: bool = False
sort_keys: bool = False
__init__(fail_on_resource_errors: bool = False, max_asset_size_bytes: int = 52428800, metadata_policy: MetadataRenderPolicy = <factory>, creator: str | None = 'all2md', indent: int | None = 2, ensure_ascii: bool = False, sort_keys: bool = False) None