Fortran Notebook - jupytext-style interactive computing with markdown/PDF output.
fnb provides jupytext-style notebook support for Fortran, enabling interactive computing, data visualization, and literate programming. It integrates with the lazy-fortran ecosystem for compilation and execution, generating markdown and PDF output rather than traditional Jupyter notebooks.
- Jupytext-style notebook parsing and execution
- Interactive Fortran code cells (.f files)
- Figure capture and visualization
- Markdown and PDF output rendering
- Integration with fortrun for code execution
- Support for notebook conversion and format handling
fpm build
Execute a notebook:
fnb run analysis.f
Render to markdown:
fnb render analysis.f -o output.md
Render to PDF:
fnb render analysis.f -o output.pdf
fnb uses jupytext-style .f files with special comments for cells and markdown:
! ## Hello World Example
! This is a markdown cell explaining the code below
x = 5.0
y = 3.0
result = sqrt(x**2 + y**2)
print *, "Distance:", result
! ## Visualization
! Generate a simple plot
! (figure capture and output will be included in rendered output)
- fortfront - Frontend analysis
- json-fortran - JSON parsing
- fortrun (runtime) - Code execution and caching
notebook_types
- Notebook data structuresnotebook_parser
- Notebook parsing from JSONnotebook_executor
- Cell execution enginenotebook_renderer
- Markdown/PDF output renderingfigure_capture
- Plot and figure handling
MIT License - see LICENSE file for details.