Contributing to HEMMS Documentation¶
This guide covers how to add and edit pages in the HEMMS documentation site, which is built with MkDocs Material.
Prerequisites¶
Install the documentation toolchain:
This installs MkDocs Material and all required plugins into your current Python environment. If you prefer isolation, use a virtual environment:
Local preview¶
Start a live-reloading dev server:
Open http://localhost:8000 in your browser. Edits to any .md file or mkdocs.yml trigger an automatic rebuild and browser refresh.
Adding a new page¶
-
Create a Markdown file in the appropriate
docs/subfolder: -
Add YAML frontmatter at the top:
-
Write your content using standard Markdown.
-
Register the page in
mkdocs.ymlunder thenav:section: -
Check the result at http://localhost:8000.
Writing conventions¶
Headings¶
Use # for the page title (one per page), ## for major sections, and ### for subsections. MkDocs generates the table of contents from headings.
Admonitions¶
Use admonitions to highlight important information:
!!! info "Good to know"
This is an informational callout.
!!! warning
This warns the reader about a potential issue.
!!! tip "Pro tip"
A helpful suggestion for advanced users.
!!! danger "Breaking change"
Something that could cause data loss or downtime.
Available types: note, abstract, info, tip, success, question, warning, failure, danger, bug, example, quote.
Collapsible admonitions use ??? instead of !!!:
Code blocks¶
Specify the language for syntax highlighting:
```python
class MyModel(models.Model):
_name = 'my.model'
name = fields.Char(string='Name', required=True)
```
Add a title to code blocks:
Highlight specific lines:
```python hl_lines="2 3"
class MyModel(models.Model):
_name = 'my.model'
name = fields.Char(string='Name')
```
Screenshots and images¶
Place images in the docs/assets/ folder and reference them with relative paths:
Always include descriptive alt text. Images are displayed with the glightbox plugin — clicking on an image opens a lightbox overlay.
Cross-linking between pages¶
Use relative paths from the current file:
Link to a specific section using the heading anchor:
Tabs¶
Use content tabs for platform-specific instructions:
=== "Private Hospital"
```bash
make up-private
make install-private
```
=== "Government Hospital"
```bash
make up-gov
make install-gov
```
Definition lists¶
Use for glossary-style entries:
BME
: Biomedical Engineering — the department responsible for medical equipment.
SLA
: Service Level Agreement — the maximum time allowed for each repair stage.
Building for production¶
To verify the site builds without warnings:
This runs mkdocs build --strict, which fails on any broken links or configuration warnings. The output goes to the site/ directory (git-ignored).
Submitting changes¶
-
Create a feature branch:
-
Make your changes and verify locally with
make docs-serve. -
Run the strict build to catch issues:
-
Commit and push:
-
Open a pull request. The CI workflow will build the docs and report any errors.