firecrown.fctools.symbol_reference_checker ========================================== .. py:module:: firecrown.fctools.symbol_reference_checker .. autoapi-nested-parse:: Validate Firecrown symbol references in Quarto (.qmd) files. This tool extracts all inline code spans (backticks) from tutorial files and validates that any Firecrown symbol references actually exist in the codebase. It checks: - Fully-qualified names (e.g., firecrown.likelihood.SourceSystematic) - Partial module paths (e.g., firecrown.likelihood) - Unqualified class/function names (e.g., Updatable) Attributes ---------- .. autoapisummary:: firecrown.fctools.symbol_reference_checker.app Functions --------- .. autoapisummary:: firecrown.fctools.symbol_reference_checker.extract_code_spans firecrown.fctools.symbol_reference_checker.check_qmd_file firecrown.fctools.symbol_reference_checker.main Module Contents --------------- .. py:data:: app .. py:function:: extract_code_spans(content) Extract all inline code spans from markdown content. :param content: The markdown content to parse :return: List of (line_number, code_text) tuples .. py:function:: check_qmd_file(file_path, symbol_map, external_symbols = None, exclude_pattern = None) Check a .qmd file for invalid Firecrown symbol references. :param file_path: Path to the Quarto (.qmd) file to check :param symbol_map: Dictionary mapping valid symbols to their URLs :param external_symbols: Set of allowed external symbols :param exclude_pattern: Optional regex pattern for symbols to exclude from checking :return: List of error messages for invalid symbol references .. py:function:: main(directory = typer.Argument(..., help='The directory containing .qmd files to check', exists=True), symbol_map_file = typer.Argument(..., help='Path to the JSON file containing the symbol map', exists=True), exclude_pattern = typer.Option(None, help='Regex pattern for symbols to exclude from checking'), external_symbols_file = typer.Option(None, help='Path to text file containing allowed external symbols (one per line)')) Validate Firecrown symbol references in Quarto (.qmd) files. Extracts all inline code spans (backticks) from tutorial files and validates that any Firecrown symbol references actually exist in the codebase. Checks: - Fully-qualified names (e.g., firecrown.likelihood.SourceSystematic) - Partial module paths (e.g., firecrown.likelihood) - Unqualified class/function names (e.g., Updatable) Exit codes: 0: No invalid symbol references found 1: Invalid symbols found or input error