Skip to content

Commit 5551fed

Browse files
committed
notebook viewer
Signed-off-by: Lawrence Lane <llane@nvidia.com>
1 parent da3bed9 commit 5551fed

6 files changed

Lines changed: 833 additions & 0 deletions

File tree

fern/AUTODOCS_GUIDE.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,30 @@ fern docs dev
4949
```
5050

5151
Use the **API Reference** tab to browse generated pages after running `fern docs md generate`.
52+
53+
## Jupyter notebooks (`NotebookViewer`)
54+
55+
Static tutorial notebooks are rendered with the **`NotebookViewer`** React component (ported from NeMo Data Designer), optional **Colab** link, and **`fern/styles/notebook-viewer.css`** (registered in `docs.yml`).
56+
57+
1. **Dependencies:** `pygments` (for syntax-highlighted code cells when converting).
58+
59+
2. **Convert** `.ipynb` → JSON + TypeScript module for MDX import:
60+
61+
```bash
62+
cd fern
63+
python scripts/ipynb-to-fern-json.py ../path/to/notebook.ipynb -o components/notebooks/my-notebook.json
64+
```
65+
66+
3. **Use** in MDX:
67+
68+
```mdx
69+
import { NotebookViewer } from "@/components/NotebookViewer";
70+
import notebook from "@/components/notebooks/my-notebook";
71+
72+
<NotebookViewer
73+
notebook={notebook}
74+
colabUrl="https://colab.research.google.com/github/NVIDIA/bionemo-framework/blob/main/..."
75+
/>
76+
```
77+
78+
`experimental.mdx-components` in `docs.yml` already includes `./components`, so `@/components/...` resolves.

0 commit comments

Comments
 (0)