This document outlines the current status and future implementation plan for the CLAMS Documentation Hub.
This repository is a hybrid. It serves two primary functions:
- It contains the source code and build process for the main documentation (
clams-main). - It acts as a central publication hub for the generated HTML from both itself and all external CLAMS subprojects.
- Repository Structure: A hybrid structure is now in place.
- Main Docs Source: The Sphinx source for the
clams-maindocumentation is located in thedocumentation/directory. - Build Script: A Python script at
build/main.pyexists to run the Sphinx build for the main documentation. - Dependencies: Build dependencies are located in
build/requirements.txt. - Generated Content: The output for
clams-mainis located indocs/clams-main/latest/. - Automation: The GitHub Actions workflow is not yet functional and does not use the new build script.
The following steps will implement a robust, automated, and scalable architecture.
The immediate next step is to create a functional GitHub Actions workflow that automates the build and deployment of the documentation sourced from this repository.
Tasks:
- Update the workflow file at
.github/workflows/publish-docs.yml. - This workflow will trigger on pushes to the
mainbranch (e.g., when changes are made indocumentation/orbuild/). - The workflow will execute the following steps:
- Check out the repository.
- Set up a Python environment.
- Install the build dependencies from
build/requirements.txt. - Run the main build script:
python build/main.py. - Commit and push any changes within the
docs/directory back to the repository.
To make the hub's landing page dynamic, we will create a dedicated build script for it.
Tasks:
- Create a
templates/directory for Jinja2 templates (e.g.,index.html.j2). - Create a
build/hub.pyscript that uses Jinja2 to render the template into the rootindex.html. This will allow the landing page to be dynamically updated with links as new projects are added. - Add
Jinja2to thebuild/requirements.txtfile. - Update the main GHA workflow to also run
python build/hub.py.
To add documentation from other repositories, we will use a modular and safe "reusable workflow" pattern.
Tasks:
- Create a "callable" workflow file (e.g.,
.github/workflows/build-external-doc.yml). This workflow will be responsible for checking out an external repository, running its unique build process, and uploading the resulting HTML as a build artifact. - Update the main
publish-docs.ymlorchestrator workflow to:- Call the reusable workflow for each external subproject.
- Include a final
publishjob that downloads all artifacts from the build jobs and commits them to thedocs/directory in a single, safe transaction.