Contributing
This guide helps you contribute to the Engineering Handbook using Material for MkDocs.
Installation
-
Clone the repository:
git clone https://github.com/futuredapp/Engineering-Handbook.git cd Engineering-Handbook -
Create a Virtual Environment:
python3 -m venv myenv -
Activate the Virtual Environment:
source myenv/bin/activate -
Install the required packages:
pip install mkdocs-material pip install mkdocs-glightboxNote
The
mkdocs-materialand plugin dependencies must be installed in the same Python environment.
Installingmkdocs-materialfrom Homebrew and other plugins (mkdocs-glightbox) usingpipmight not work for you if you usepyenvor similar environment management tools. -
When you're done, you can deactivate the environment with:
deactivate
Local Development
-
Activate the Virtual Environment:
source myenv/bin/activate -
Run the following command from the repository root to start a local development server with live-reloading:
mkdocs serveThe documentation will be available at http://127.0.0.1:8000/Engineering-Handbook/.
-
When you're done, you can deactivate the environment with:
deactivate
Editing Guidelines
Making Changes
- Create a new branch from
main - Make your changes
- Open a pull request to the Engineering Handbook repository
- Get at least one approval before merging
- After merging, the GitHub Action Pages workflow will automatically publish the updated documentation
Diagrams
Some diagrams are created using Excalidraw. When exporting images, ensure following:
- Embed scene into exported image, or commit source
.excalidrawfile to the repository so it can be edited later by someone else. - Respect light and dark themes - export 2 images for light and dark backgrounds. Use the
#only-lightand#only-darksuffixes to specify which theme the image is for. See Light and dark mode for more details. - Use the
data-galleryattribute to group images into a light gallery. For example,data-gallery="light"for light mode images anddata-gallery="dark"for dark mode images. This ensures that lightbox will not display dark mode images in light mode and vice versa.
Related issue: blueswen/mkdocs-glightbox/issues/26
Full example of diagram with transparent background in light and dark variant and lightbox support:
{data-gallery="light"}
{data-gallery="dark"}
Markdown Syntax
Material for MkDocs uses standard Markdown with some additional features
- Admonitions:
!!! note "Title" Content of the note
Editing Navigation
Edit the mkdocs.yml file to adjust the navigation structure.
Adding New Pages
- Create a new Markdown file in the appropriate directory
- Add the page to navigation in
mkdocs.ymlif needed
Project Structure
mkdocs.yml # Configuration file
docs/
index.md # Documentation homepage
editors.md # Editors manual
Teams/ # Teams space
Team name/
... # Pages
Resources/ # Images, Diagrams, etc.
Troubleshooting
For more detailed information, refer to the Material for MkDocs documentation.