This repository contains the source code for the CAREamics documentation website. The website is built using Zensical.
At build time, the CI runs a script to copy the latest stable release of CAREamics into a local folder. From there on, it extracts the version number and generates the API reference pages. Finally, it edits zensical.toml with the navigation page.
Two scripts are called for this purpose:
pull_from_repos.shhandles the cloning/updating of the repositories, copying the relevant files, and updatingzensical.tomlwith the navigation entries corresponding to the guides. It also creates a symlink to a local version of the repo if the--localoption is used (see below), and version files used to indicate for which version the website is currently built and record new versions withmikein the CI.gen_ref_pages.pygenerates the API reference pages based on the copied files and updateszensical.tomlwith the navigation entries corresponding to the API reference.
Note
Currently, unless using a local repo, the latest stable release of careamics is used to build the website. In the near future, we could use the --dev option together with a new CI to build a "dev" version of the website based on the main branch instead.
In order to build the pages locally, follow these steps:
-
Fork this repository and clone it.
-
Create a new environment and install the dependencies:
uv sync
-
Run the script to get the latest release of CAREamics:
bash scripts/pull_from_repos.sh --write
--writeindicates that thezensical.tomlwill be updated. -
Generate the reference pages:
uv run python scripts/gen_ref_pages.py --write
-
Build the pages:
uv run zensical serve
-
Open the local link in your browser.
Note: This will not show you the versioning mechanism.
In step 3, use instead:
bash scripts/pull_from_repos.sh --write --local /path/to/local/careamicsBefore committing changes, make sure to use the pre-commit hook to avoid committing navigation from the pages that are automatically added at build time.
To add pre-commit:
uv run pre-commit installTo run the hooks:
uv run pre-commit run --all-filesThis can be useful when one of the project has changed and we need to update the API doc. In such a case, use the dispatch workflow option of the CI (maintainers only).
The version release process is automated using mike in the CI. Upon pushing a new tag,
the CI will build the documentation for that version the next time it is triggered.