Build class documentation
The documentation of all classes are included in the code as comments. This kind of documentation process is called LuaDoc. But we build the html files for the documentation with LuaDocumentor. It is a tool similar to LuaDoc, but with some additional features the Moose team decided to use.
The team created also some modifications, which are not part of the official LuaDocumentor tool. So we use the code in the git repository Applevangelist/luadocumentor in the branch
patch-1.
There are two git repositories which are used to save the generated documentation:
- MOOSE_DOCS is the repository for the
masterbranch of MOOSE- A configured GitHub Pages job will deploy the result to:
https://flightcontrol-master.github.io/MOOSE_DOCS/
- A configured GitHub Pages job will deploy the result to:
- MOOSE_DOCS_DEVELOP is the repository for the
developbranch of MOOSE- A configured GitHub Pages job will deploy the result to:
https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/
- A configured GitHub Pages job will deploy the result to:
Main build steps to create the class documentation are defined in .github/workflows/build-docs.yml:
- Checkout of the git repository MOOSE.
- Create output folders.
- Checkout of the git repository Applevangelist/luadocumentor with
branch
patch-1into a subdirectory. - Update the Linux system software.
- Install needed tools:
- tree - A tool to output a tree view of a folder structure.
- lua - Package to run Lua scripts. This time Lua 5.1, because it matches the DCS environment.
- LuaRocks - This is the package manager for Lua modules.
- markdown - Dependency for LuaDocumentor
- penlight - Dependency for LuaDocumentor
- metalua-compiler - Dependency for LuaDocumentor
- metalua-parser - Dependency for metalua-compiler
- checks - Dependency for metalua-parser
- Run the build steps:
- Run
luadocumentor.luato create the html files.
- Run
- Deploy build results:
- Checkout MOOSE_DOCS or MOOSE_DOCS_DEVELOP git repository in a subdirectory.
- Use the matching git repository for the branch of MOOSE.
master-> MOOSE_DOCS.develop-> MOOSE_DOCS_DEVELOP.
- Use a
TOKENfor checkout, so apushis possible later on.
- Use the matching git repository for the branch of MOOSE.
- Copy build result to
MOOSE_DOCSfolder. - Push results to the target repository.
- Checkout MOOSE_DOCS or MOOSE_DOCS_DEVELOP git repository in a subdirectory.
Build a preview locally
To generate a preview of the class documentation go into the folder
docker/build-docks and run docker compose up. It will create a Docker image
and start a Docker container. Within this container all needed software packages
are included to build to class documentation.
- You need a working installation of Docker.
- In the main repository folder a new folder
buildwill be created. - Subfolders
build/docsandbuild/toolswill be generated. - Repo
Applevangelist/luadocumentorwill be checked out tobuild/tools/luadocumentor luadocumentor.luawill be executed and writes the output tobuild/docs.
If MOOSE_DOCS is checked out to
/moose/build/MOOSE_DOCSby the developer manually, then the generated files are also copied into/moose/build/MOOSE_DOCS/Documentation/. This allows to rundocker compose upin/moose/build/MOOSE_DOCS/docker/, so the full result can be checked.