This document explains how to build and work with the SCHISM-ESMF documentation.
The project documentation is built using MkDocs with the Material theme. The documentation sources are in Markdown format located in the doc/ directory.
schism-esmf/
├── doc/ # Documentation source files
│ ├── index.md # Homepage
│ ├── installation.md # Installation guide
│ ├── cmake-architecture.md # CMake build system details
│ ├── running-examples.md # How to run examples
│ ├── legal.md # License and legal information
│ ├── logo.png # Project logo
│ └── CMakeLists.txt # CMake build rules for docs
├── mkdocs.yml # MkDocs configuration
├── Readme.md # Main project README (linked in docs)
├── QUICKSTART.md # Quick start guide (linked in docs)
└── .github/
└── BUILD_TROUBLESHOOTING.md # Build troubleshooting (linked in docs)
pip install mkdocspip install mkdocs-materialpip install mkdocs mkdocs-material
conda install -c conda-forge mkdocs mkdocs-material
poetry install
The documentation build is integrated into the CMake build system.
mkdir -p build && cd build
cmake .. -DBUILD_DOCS=ON
make docs
The built documentation will be in build/docs/.
make docs-serve
This starts a local web server at http://127.0.0.1:8000 with live reloading.
make docs-clean
You can also build documentation directly with MkDocs without CMake:
mkdocs build
Output goes to site/ directory.
mkdocs serve
Navigate to http://127.0.0.1:8000 to view.
mkdocs build --strict
The --strict flag treats warnings as errors.
The documentation build is controlled by the BUILD_DOCS CMake option:
option(BUILD_DOCS "Build HTML documentation with MkDocs" OFF)
It’s OFF by default to avoid requiring Python/MkDocs for users who only want to build the software.
If your Fortran/MPI toolchain isn’t available, you can configure a documentation-only build:
mkdir -p build && cd build
cmake .. -DDOCS_ONLY=ON # Implicitly sets -DBUILD_DOCS=ON
# Build user guide (MkDocs)
cmake --build . --target docs
# Build API reference (FORD - requires ford installed)
cmake --build . --target docs-api
# Build both
cmake --build . --target docs-all
For details on writing FORD-style documentation in the Fortran source code, see the API Documentation Guide.
| Target | Description |
|---|---|
docs |
Build HTML user guide (MkDocs) |
docs-api |
Build API reference from Fortran source (FORD) |
docs-all |
Build both user guide and API reference |
docs-serve |
Start local documentation server |
docs-clean |
Remove built documentation |
When you run make install, the documentation is installed to:
${CMAKE_INSTALL_PREFIX}/share/doc/SCHISM_ESMF_Interface/html/${CMAKE_INSTALL_PREFIX}/share/doc/SCHISM_ESMF_Interface/markdown/${CMAKE_INSTALL_PREFIX}/share/doc/SCHISM_ESMF_Interface/ (Readme.md, QUICKSTART.md)Example:
cmake .. -DBUILD_DOCS=ON -DCMAKE_INSTALL_PREFIX=/usr/local
make docs
sudo make install
name: Build Documentation
on:
push:
branches: [main, develop]
pull_request:
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install mkdocs mkdocs-material
- name: Build documentation
run: mkdocs build --strict
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
run: mkdocs gh-deploy --force
To deploy documentation to GitHub Pages:
mkdocs gh-deploy
This builds and pushes the documentation to the gh-pages branch.
All documentation files are Markdown (.md) with YAML front matter:
---
title: Page Title
summary: Brief description
---
# Main Heading
Content here...
Use fenced code blocks with language specification:
```python
def hello():
print("Hello, SCHISM!")
```
Use Material theme admonitions for callouts:
!!! note "Important Note"
This is an important note.
!!! warning
This is a warning.
!!! tip
This is a helpful tip.
Link to other documentation pages:
See [Installation Guide](/schism-esmf/doc/installation.html) for details.
Link to GitHub files:
See [BUILD_TROUBLESHOOTING.md](../.github/BUILD_TROUBLESHOOTING.md).
Problem: Python3 not found during CMake configure.
Solution: Install Python 3.8+ and ensure it’s in your PATH.
# macOS
brew install python@3.11
# Ubuntu/Debian
sudo apt install python3 python3-pip
# Windows
# Download from python.org
Problem: MkDocs not found warning during CMake configure.
Solution: Install MkDocs:
pip install mkdocs mkdocs-material
Problem: MkDocs Material theme not found warning.
Solution: Install the Material theme:
pip install mkdocs-material
Problem: Documentation build fails with Python import errors.
Solution: Check that all required packages are installed:
python3 -c "import mkdocs; print(mkdocs.__version__)"
python3 -c "import material; print(material.__version__)"
If either fails, reinstall:
pip install --upgrade mkdocs mkdocs-material
Problem: Changes to markdown files don’t appear in built docs.
Solution:
make docs-clean or rm -rf site/make docs or mkdocs buildWhen using mkdocs serve, changes should auto-reload. If not, restart the server.
site_name: Project Name # Site title
site_url: https://example.com # Base URL
docs_dir: ./doc # Source directory
site_dir: ./site # Output directory
theme:
name: material # Theme name
features: [...] # Theme features
nav: # Navigation structure
- Home: index.md
- Guide: guide.md
markdown_extensions: [...] # Markdown processing extensions
plugins: [...] # MkDocs plugins
Enabled features in mkdocs.yml:
toc.integrate - Integrate table of contents into navigationtoc.follow - Follow active item in ToCcontent.code.annotate - Code annotation supportnavigation.tabs - Top-level navigation tabsnavigation.sections - Group pages into sectionsnavigation.expand - Expand sections by defaultnavigation.top - “Back to top” buttonsearch.suggest - Search suggestionssearch.highlight - Highlight search termsKey extensions enabled:
admonition - Note/warning boxescodehilite - Syntax highlightingpymdownx.superfences - Nested code blockspymdownx.tabbed - Tabbed contentpymdownx.details - Collapsible sectionsmkdocs serve to preview changesmkdocs.yml nav sectionCheck for MkDocs updates:
pip list --outdated | grep mkdocs
Update:
pip install --upgrade mkdocs mkdocs-material
Install link checker:
pip install linkchecker
Check built docs:
mkdocs build
linkchecker site/
Before committing documentation changes:
--strict flag passesmkdocs serve looks correctLast Updated: November 2025
Maintainer: Carsten Lemmen carsten.lemmen@hereon.de