Skip to content

Render .ipynb to html at build time #208

Description

@celiasmith

The LMU and MNIST submissions both ship .ipynb files as tutorial / canonical artifacts. Today they're download-only — users have to grab the zip and open in Jupyter to actually read them. They should be readable inline.

Goal

For every submission that contains an .ipynb, the static site renders it to HTML as part of the build and surfaces it from the detail page.

Implementation sketch

  • Add nbconvert to tools/build_site.py's dependency list.
  • Walk each submission's folder for *.ipynb files alongside the existing figure detection.
  • Render to HTML via nbconvert.HTMLExporter (with the lab template for clean output).
  • Write to site/submissions/<name>/notebooks/<name>.html.
  • Add a Notebooks section in the detail page sidebar listing the rendered notebooks.
  • Style outputs so they don't break our existing CSS (notebook CSS is fairly self-contained; should mostly Just Work).

Constraints

  • Don't execute notebooks at build time — render them with whatever outputs the contributor committed. Executing would couple Pages builds to model runtimes, which we explicitly don't want.
  • Skip notebooks larger than a sensible limit (~1MB rendered HTML?) and warn instead — they're usually packed with images that bloat the site.

Bonus

  • Use the first markdown cell as the notebook's "tagline" displayed in the sidebar listing.
  • Consider a per-card thumbnail if the notebook has a figures/preview.png adjacent.

Acceptance

Visiting /submissions/lmu/ shows a "Notebook" link in the sidebar that opens an in-browser-readable LMU walkthrough.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions