This repository contains the source for the documentation for Template Operator. It is built using MkDocs which is based on Python. It is also versioned using mike.
This repository has GitHub action workflow which checks the quality of the documentation and builds the Dockerfile image on Pull Requests. On a push to the main branch, it will create a GitHub release and push the built image to an image repository.
- Fork the repository
- Make a pull request
- Workflow will run QA checks, make sure all jobs have succeeded before requesting a review
- Pull requests builds are published for review on
https://stakater.github.io/template-operator-docs/<branch-name>/ - On merge of a pull request, the documentation is published on
docs.stakater.com
Note
For MkDocs overrides, it is important to know that you should only make changes in the theme_override and the content directory.
Be mindful of only changing the theme_override/mkdocs.yml file since there are more than one such file.
Before deploying or deleting a version, make sure to specify the correct latest version in the workflow files.
Make sure the latest doc version is also specified in the versioned branches.
This project contains a git submodule and if you need to update it, use this command:
git submodule update --init --recursive --remoteView the .gitmodules file to see linked git submodules.
There are at least two options to get fast continuous feedback during local development:
- Build and run the docs using the Dockerfile image
- Run the commands locally
Build Dockerfile test image:
docker build . -t test -f DockerfilelocalRun test container:
docker run -p 8080:8080 testThen access the docs on localhost:8080.
Use virtualenvwrapper to set up Python virtual environment.
Install Python 3.
Install python environment dependencies if you are using any other than what is defined in theme_common.
Then run below script to prepare theme from local and common theme resources. It will output to dist/_theme directory and create mkdocs.yml file in root directory. We are also installing the python dependencies coming from theme_common here.
./prepare_theme.shFinally, serve the docs using the built-in web server which is based on Python http server - note that the production build will use nginx instead:
mike serveor
python3 -m mike serveThen, you can make changes in content or dist/_theme folder. Please note that dist/_theme is a build folder and any changes made here will be lost if you do not move them to the theme_common or the theme_override folder.
You can run QA checks locally. They are also run as part of pull request builds.
To run markdown linting:
brew install markdownlint-cli
markdownlint -c .markdownlint.yaml contentTo run spell checking:
brew install vale
vale sync
vale content