all2md.options.sourcecode
Configuration options for source code parsing.
This module defines options for parsing source code files with syntax highlighting.
- class all2md.options.sourcecode.SourceCodeOptions
Bases:
BaseParserOptionsConfiguration options for source code to Markdown conversion.
This dataclass contains settings specific to source code file processing, including language detection, formatting options, and output customization.
- Parameters:
detect_language (bool, default True) – Whether to automatically detect programming language from file extension. When enabled, uses file extension to determine appropriate syntax highlighting language identifier for the Markdown code block.
language_override (str or None, default None) – Manual override for the language identifier. When provided, this language will be used instead of automatic detection. Useful for files with non-standard extensions or when forcing a specific syntax highlighting.
include_filename (bool, default False) – Whether to include the original filename as a comment at the top of the code block. The comment style is automatically chosen based on the detected or specified language.
- detect_language: bool = True
- language_override: str | None = None
- include_filename: bool = False
- __init__(extract_metadata: bool = False, detect_language: bool = True, language_override: str | None = None, include_filename: bool = False) None