[[TOC]]
All aimms docs repos build the same way: with uv and the versions pinned in
pyproject.toml (Sphinx 8, sphinx-aimms-theme 1.x). The CI pipeline uses exactly the same setup, so what
builds here builds there.
One-time setup
- Install uv:
winget install astral-sh.uvon Windows, orcurl -LsSf https://astral.sh/uv/install.sh | shon macOS and Linux. - Run
uv sync. It creates a.venvfolder with Python 3.11 and the exact packages ofuv.lock.
Build
uv run sphinx-build -b html . _build/html
Open _build/html/index.html in your browser. The pipeline runs the same command with -W --keep-going,
which turns every warning into an error: run uv run sphinx-build -W --keep-going -b html . _build/html
before you push.
Live preview: rebuilds and refreshes the browser each time you save a file.
uv run --group dev sphinx-autobuild . _build/html
Spell check: uv run sphinx-build -b spelling . _build/spelling. It needs the enchant library: included
on Windows, sudo apt install libenchant-2-2 on Ubuntu, brew install enchant on macOS.
Try a theme change before it is released: in the sphinx-aimms-theme repo, run
scripts\build-all-local.ps1 -Sites language-reference. It builds this repo with the theme from your folder and
changes nothing here.
File names are case sensitive on Linux (the pipeline) but not on Windows, and a title underline must be at least as long as the title.
💡1: GitLab CI is following exactly the same process when building the documentation in the pipeline. This is defined in the .gitlab-ci.yml file. More details below
⚠️ 2: When pushing to the master branch only, the repo is built and pushed (merged) to documentation.aimms.com/language-reference/.
⚠️ 3: If any warning is raised on gitlab, the pipeline fails
You can use the make latexpdf command to locally create a .pdf from the .rst source files.
First, make sure you installed Latex - https://miktex.org/howto/install-miktex
Then, to get the AIMMS code to look right, you need to run this:
python -m pip install aimms-pygments-style
This will install an extension enabling latex to find the AIMMS style sheet define in the following open source repo https://gitlab.com/ArthurdHerbemont/aimms-pygments-style. Please contribute if you think you can improve it ! :)