MOLE Documentation Guide
This is the definitive guide for building and maintaining the documentation for the MOLE.
Documentation Structure
The MOLE documentation consists of two main components:
API Documentation (Doxygen)
C++ API reference
MATLAB/Octave API reference
Implementation details
Code documentation
User Manual (Sphinx)
Tutorials
Examples
Usage guides
Theory background
️Building Documentation
Prerequisites
Before building the documentation, ensure you have:
Doxygen installed on your system (for API documentation)
# Ubuntu/Debian sudo apt install doxygen # macOS with Homebrew brew install doxygen # RHEL/CentOS/Fedora sudo dnf install doxygen
Graphviz installed for generating diagrams
# Ubuntu/Debian sudo apt install graphviz # macOS with Homebrew brew install graphviz # RHEL/CentOS/Fedora sudo dnf install graphviz
Inkscape installed for high-quality SVG to PDF conversion (required for PDF output)
# Ubuntu/Debian sudo apt install inkscape # macOS with Homebrew brew install inkscape # RHEL/CentOS/Fedora sudo dnf install inkscape
LaTeX (required for PDF generation):
# Ubuntu/Debian sudo apt install texlive-latex-base texlive-fonts-recommended texlive-latex-extra # RHEL/CentOS/Fedora sudo dnf install texlive-scheme-medium # macOS brew install --cask mactex
GraphViz (required for diagrams):
# Ubuntu/Debian sudo apt install graphviz # macOS brew install graphviz # RHEL/CentOS/Fedora sudo dnf install graphviz
Python dependencies: First, ensure Python 3 and pip are installed:
# Ubuntu/Debian sudo apt install python3 python3-pip python3-venv # RHEL/CentOS/Fedora sudo dnf install python3 python3-pip python3-virtualenv
Then set up the Python environment:
# Navigate to the documentation directory cd doc/sphinx # Create and activate a virtual environment (Required) python3 -m venv .venv source .venv/bin/activate # On Unix/MacOS # or .venv\Scripts\activate # On Windows # Install required dependencies # Either use: make doc-deps # Or install directly: python3 -m pip install -r requirements.txt
Building Steps
All commands should be run from the doc/sphinx
directory:
# Generate API Documentation
make doc-doxygen
# Build HTML documentation
make doc-html
# PDF output (requires LaTeX and Inkscape)
make doc-latexpdf
# Clean build files (Doxygen + Sphinx)
make doc-clean
# Build all documentation
make doc-all
The documentation will be generated in:
HTML:
doc/sphinx/build/html/
PDF:
doc/sphinx/build/latex/MOLE-docs.pdf
and at the project root (MOLE-docs.pdf
)API Docs:
doc/doxygen/
PDF Generation Process
The PDF generation process does the following:
Runs Sphinx to generate LaTeX files
Converts SVG figures to high-quality PDF using Inkscape (2400 DPI)
Applies special fixes to LaTeX files for proper math rendering
Compiles the LaTeX document into a PDF
Copies the final PDF to the project root directory
This process is handled by the build.sh
script, which is called by the doc-latexpdf
make target.
Image Handling
Images are automatically handled when building the documentation using the Makefile targets:
The image handling process:
Copies images from
doc/assets/img/
todoc/sphinx/build/html/_static/img/
Fixes image paths in the HTML output
For PDF output, converts SVG files to high-quality PDFs (using Inkscape)
If you’re running Sphinx directly without the Makefile, you’ll need to run the image copy script separately:
# Run after building documentation manually
./copy_images.sh
Development Workflow
When contributing to documentation:
API Documentation
Add C++ documentation in source code using Doxygen syntax
Build with
make doc-doxygen
to verify
User Manual
Edit
.rst
or.md
files indoc/sphinx/source/
Build with
make doc-html
to preview changesUse
make doc-clean
to force full rebuild
Documentation Standards
Use clear, concise language
Include working code examples
Follow Sphinx reST syntax
Follow Doxygen conventions for API docs