FORD-Powered Parsing
Parses Fortran sources using FORD's battle-tested parser. Works with any FORD-compatible project.
Generate beautiful documentation websites for Fortran projects using FORD + VitePress.
Projects using FORMAL for their API documentation:
Stefano Zaghi -- szaghi
This project is distributed under a multi-licensing system:
Anyone interested in using, developing, or contributing to this project is welcome — pick the license that best fits your needs.
pipx install formal-ford2vitepressOr with pip:
pip install formal-ford2vitepressgit clone https://github.com/szaghi/formal.git
cd formal
pipx install -e .cd /path/to/your/fortran/project
formal init --name "MyProject" --author "Your Name"
cd docs && npm install
formal generate
npm run docs:dev # opens http://localhost:5173# If you already have a FORD project file:
formal generate --project doc/main_page.md --output docs/api
# Or let FORMAL auto-detect:
formal generateformal init Scaffolds a VitePress documentation site and creates a FORD project file.
formal init [project_root] [options]| Option | Default | Description |
|---|---|---|
project_root | . | Root of the Fortran project |
--name NAME | Directory name | Project name |
--src-dir DIR [DIR...] | Auto-detect src/ | Source directories |
--exclude-dir DIR [DIR...] | Auto-detect | Directories to exclude |
--docs-dir DIR | docs | Where to create VitePress site |
--ford-file PATH | doc/formal.md | FORD project file location |
--docmark MARK | < | FORD doc comment marker (< = !<) |
--author NAME | Author name | |
--no-math | Disable LaTeX math support | |
--no-fortran-highlight | Disable Fortran syntax aliases |
formal generate Parses Fortran sources and generates VitePress Markdown API documentation.
formal generate [options]| Option | Default | Description |
|---|---|---|
--project FILE | Auto-detect | FORD project file path |
--output DIR | docs/api | Output directory for generated files |
--src-root PATH | Auto-detect | Root path to strip from source paths |
--quiet | Suppress progress output |
Fortran .F90 sources
|
| FORD parser (load_settings + Project + correlate)
| extracts modules, types, procedures, doc_list
v
FORD Project object model
|
| FORMAL generator (format_module, format_type, ...)
| walks the object tree, generates Markdown
v
docs/api/*.md + _sidebar.json
|
| VitePress (npm run docs:build)
v
Static HTML documentation siteFORD's pipeline goes parse -> correlate -> markdown -> HTML. FORMAL hooks in after correlate() and reads the raw doc_list (Markdown strings) from every entity, skipping FORD's own HTML generation entirely. VitePress handles the Markdown-to-HTML conversion with its own theme.