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)
- Python 3.8+
- MkDocs:
pip install mkdocs - MkDocs Material theme:
pip install mkdocs-material
pip install mkdocs mkdocs-materialconda install -c conda-forge mkdocs mkdocs-materialpoetry installThe documentation build is integrated into the CMake build system.
mkdir -p build && cd build
cmake .. -DBUILD_DOCS=ONmake docsThe built documentation will be in build/docs/.
make docs-serveThis starts a local web server at http://127.0.0.1:8000 with live reloading.
make docs-cleanYou can also build documentation directly with MkDocs without CMake:
mkdocs buildOutput goes to site/ directory.
mkdocs serveNavigate to http://127.0.0.1:8000 to view.
mkdocs build --strictThe --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-allFor 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:
- HTML documentation:
${CMAKE_INSTALL_PREFIX}/share/doc/SCHISM_ESMF_Interface/html/ - Markdown sources:
${CMAKE_INSTALL_PREFIX}/share/doc/SCHISM_ESMF_Interface/markdown/ - Top-level docs:
${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 installname: 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 --forceTo deploy documentation to GitHub Pages:
mkdocs gh-deployThis 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](installation.md) 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.orgProblem: MkDocs not found warning during CMake configure.
Solution: Install MkDocs:
pip install mkdocs mkdocs-materialProblem: MkDocs Material theme not found warning.
Solution: Install the Material theme:
pip install mkdocs-materialProblem: 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-materialProblem: Changes to markdown files don't appear in built docs.
Solution:
- Clean the build:
make docs-cleanorrm -rf site/ - Rebuild:
make docsormkdocs build
When 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 pluginsEnabled 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 terms
Key extensions enabled:
admonition- Note/warning boxescodehilite- Syntax highlightingpymdownx.superfences- Nested code blockspymdownx.tabbed- Tabbed contentpymdownx.details- Collapsible sections
- Keep files focused: Each page should cover one topic
- Use clear headings: Hierarchical structure with H1, H2, H3
- Test locally: Always run
mkdocs serveto preview changes - Link generously: Cross-link related content
- Use code examples: Show, don't just tell
- Add screenshots: Visual aids help comprehension (when applicable)
- Update navigation: Add new pages to
mkdocs.ymlnav section - Follow naming conventions: Use lowercase-with-hyphens for filenames
Check for MkDocs updates:
pip list --outdated | grep mkdocsUpdate:
pip install --upgrade mkdocs mkdocs-materialInstall link checker:
pip install linkcheckerCheck built docs:
mkdocs build
linkchecker site/Before committing documentation changes:
- Spell-check content
- Verify all links work
- Build with
--strictflag passes - Preview with
mkdocs servelooks correct - Code examples are tested and correct
- Navigation updated if new pages added
- Front matter (title, summary) is accurate
- MkDocs Issues: https://github.com/mkdocs/mkdocs/issues
- Material Theme Issues: https://github.com/squidfunk/mkdocs-material/issues
- Project Docs Issues: https://github.com/schism-dev/schism-esmf/issues
Last Updated: November 2025
Maintainer: Carsten Lemmen carsten.lemmen@hereon.de