INNER CODE UNIT · Python

process_notebook

Kotlin/kandy · util/kandy-samples-utils/nb_to_doc.py:626

def process_notebook(notebook_path: str) -> None:
    """
    Processes a Jupyter notebook and generates corresponding Markdown and Kotlin test files while preserving order.

    Args:
        notebook_path: Path to the Jupyter notebook file
    """
    try:
        base_name = os.path.splitext(os.path.basename(notebook_path))[0]
        md_output = f"{base_name}.md"
        kt_output = f"{base_name}.kt"

        test_base_name = 'notebook_test_' + base_name

        cells = extract_content(notebook_path)
        create_md_file(md_output, cells, test_base_name)
        create_kt_file(kt_output, cells, test_base_name)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…