Building the Documentation
Prerequisites
In order to build and contribute to the documentation you will need the following installed:
- bash
- Docker
Docker is required as all the build steps are performed in docker containers to ensure a consistent and known build environment. It also ensures that the local build environment matches that used in GitHub actions.
It is possible to build the docs without docker but you would need to install all the other dependencies that are provided in the docker images, hugo, npm, etc.
Cloning the event-logging-schema git repository
The git repository for this site is
event-logging-schema
.
event-logging-schema uses the Docsy theme (themes/docsy/
) which is pulled in via Go modules.
To clone the repository:
Running a local server
The documentation can be built and served locally while developing it. To build and serve the site run
This uses Hugo to build the site in memory and then serve it from a local web server. When any source files are changed or added Hugo will detect this and rebuild the site as required, including automatically refreshing the browser page to update the rendered view.
Once the server is running the site is available at localhost:1313 .
Warning
Sometimes changes made to the site source will not be re-loaded correctly so it may be necessary to stop and re-start the server.Building the site locally
To perform a full build of the static site run:
This will generate all the static content and place it in public/
.
Generating the PDF
Every page has a Print entire section link that will display a printable view of that section and its children.
In addition to this the GitHub Actions we generate a PDF of the docs
section and all its children, i.e. all of the documentation (but not News/Releases or Community) in one PDF.
This makes the documentation available for offline use.
To test the PDF generation do:
Updating the Docsy theme
The Docsy theme is pulled in as a Go module. To update the version of Docsy used see Update the Docsy Hugo Module .
When these instructions say to run the hugo
command you need to run them using the builder container, unless you have Hugo and Go installed locally.
e.g.