-
Notifications
You must be signed in to change notification settings - Fork 0
Home
This document provides internal guidance for creating, updating, and publishing documentation using MkDocs and GitHub. It outlines:
- How the site was originally built
- How the repository is structured
- How to update content using our workflow (working branch:
JS_Updates) - How to publish updated documentation using
mkdocs gh-deploy - General MkDocs notes and best practices
- Create or activate a Python virtual environment.
- Install MkDocs and Material theme:
pip install mkdocs-material
Run:
mkdocs new <project-name>This creates:
-
mkdocs.yml— main configuration file -
docs/— folder containing markdown pages
To preview live changes:
mkdocs serveSite runs locally at:
http://127.0.0.1:8000
- Create a new GitHub repo (empty except for a README).
- From local project root:
git init git add . git commit -m "Initial MkDocs project" git remote add origin <repo-url> git push -u origin main
- Ensure
.gitignoreexcludes:site/ __pycache__/ *.pyc .DS_Store
- Main branch: Production-ready documentation
-
Working branch:
JS_Updates(used for all edits before PR)
If it doesn’t exist locally:
git checkout -b JS_UpdatesIf it already exists:
git checkout JS_Updatesgit checkout JS_Updates
git pull origin main- mkdocs.yml — navigation, theme, colors, plugins
- docs/ — all markdown documentation pages
- overrides/ (optional) — templates or custom HTML/CSS overrides
- assets/ (optional) — images, GIFs, videos
Only edit content inside
docs/and the config inmkdocs.yml. Never modify the auto-generatedsite/folder.
- Switch to the working branch:
git checkout JS_Updates
- Update or create Markdown files inside
docs/. - Preview changes during editing:
mkdocs serve
git add .
git commit -m "Describe what was updated"git push -u origin JS_Updates- Open the GitHub repository.
- Click Compare & Pull Request.
- Review changes.
- Request review if needed.
- Merge into
mainonce approved.
We use MkDocs’ built-in deployment command instead of automated GitHub Actions.
Once changes are merged into main:
mkdocs gh-deployMkDocs will:
- Build the site locally
- Push contents to the
gh-pagesbranch - Update the live site
Only needs to be set once:
- Go to Settings → Pages
- Branch:
gh-pages - Folder:
/(root)
Site will be accessible at:
https://themmrf.github.io/docs-vlab/
Update the nav: section in mkdocs.yml, for example:
nav:
- Home: index.md
- Guides:
- Setup: setup.md
- Usage: usage.mdPlace images in docs/assets/:
Same syntax as images:
In mkdocs.yml:
theme:
palette:
primary: deep purple
accent: indigoYou can also use custom HEX values if needed.
-
Port already in use → kill process on port
8000 -
Plugin missing → install with
pip install <plugin> -
Site folder appears in GitHub → remove with:
git rm -r --cached site git commit -m "Remove site folder" git push - Cannot find module → installing mkdocs via Homebrew results in many dependency errors. Install via pip instead.
These can be added later:
- GitHub Actions for automated deployment
- Search enhancements using plugins
- Custom HTML templates via
overrides/ - Versioning using
mkdocs-materialbuilt-in features
This SOP outlines the full lifecycle of our MkDocs documentation process:
- Build locally with MkDocs
- Store source in GitHub
- Update via
JS_Updatesbranch → pull request → merge - Manually publish using
mkdocs gh-deploy
This ensures consistency, team collaboration, and easy maintainability.