MkDocs Documentation Guide¶
This project uses MkDocs with the Material theme for documentation. This guide covers our specific configuration, extensions, and how to use them.
Quick Start¶
# Serve docs locally with live reload
just documentation::serve
# Build static site
just documentation::build
# Open docs in browser
just documentation::open
Theme Configuration¶
We use Material for MkDocs with dark mode as the default. Users can toggle between dark and light modes using the sun/moon icon in the header.
Color scheme: Deep purple primary with purple accent.
Markdown Extensions¶
Code Blocks¶
Syntax Highlighting¶
Standard fenced code blocks with language hints:
Line Numbers and Highlighting¶
```python linenums="1" hl_lines="2 3"
def hello():
# These lines are highlighted
print("Hello!")
```
Code Annotations¶
Add numbered annotations that expand on hover:
```python
def process(data): # (1)!
return data.strip() # (2)!
```
1. This function processes input data
2. Removes leading/trailing whitespace
Inline Code Highlighting¶
Use print("inline") for inline syntax highlighting:
Tabbed Content¶
Create tabs for platform-specific or alternative content:
=== "macOS"
```bash
~/Library/Application Support/FreeCAD/Macro/
```
=== "Linux"
```bash
~/.local/share/FreeCAD/Macro/
```
=== "Windows"
```bash
%APPDATA%/FreeCAD/Macro/
```
Renders as:
Admonitions (Call-outs)¶
Create styled call-out boxes:
!!! note "Optional Title"
This is a note admonition.
!!! warning
This is a warning without a custom title.
!!! danger "Critical"
This is a danger/error admonition.
!!! tip
This is a tip admonition.
!!! info
This is an info admonition.
!!! example
This is an example admonition.
Collapsible admonitions:
??? note "Click to expand"
This content is hidden by default.
???+ note "Expanded by default"
This content is visible but can be collapsed.
Available types: note, abstract, info, tip, success, question, warning, failure, danger, bug, example, quote
Task Lists¶
Create checkbox lists:
Renders as:
- Completed task
- Incomplete task
- Another task
Keyboard Keys¶
Style keyboard shortcuts:
Renders as: Press Ctrl+C to copy.
Common keys: ctrl, alt, shift, cmd, enter, tab, esc, backspace, delete, up, down, left, right, f1-f12
Text Formatting¶
Highlighting¶
Renders as: This text is highlighted
Subscript and Superscript¶
Renders as: H2O and x2
Strikethrough¶
Renders as: deleted text
Critic Markup (for diffs/reviews)¶
Definition Lists¶
Renders as:
- Term 1
- Definition for term 1
- Term 2
- Definition for term 2
- Can have multiple definitions
Footnotes¶
Mermaid Diagrams¶
Create diagrams using Mermaid syntax:
```mermaid
graph LR
A[MCP Client] --> B[Robust MCP Server]
B --> C[FreeCAD Bridge]
C --> D[FreeCAD]
```
Renders as:
graph LR
A[MCP Client] --> B[Robust MCP Server]
B --> C[FreeCAD Bridge]
C --> D[FreeCAD] Supported diagram types: flowchart, sequence, class, state, ER, gantt, pie, journey
Plugins¶
Git Revision Date¶
Pages automatically show "Last updated X ago" at the bottom. No action needed.
Image Lightbox (GLightbox)¶
All images are automatically zoomable. Click any image to open in a lightbox overlay.
To exclude an image from lightbox:
Minification¶
HTML is automatically minified in production builds. No action needed.
Search¶
Full-text search is enabled. Features:
- Search suggestions as you type
- Search result highlighting
- Shareable search URLs
Macros Plugin¶
Custom Delimiters¶
Important
We use custom delimiters to avoid conflicts with Python dict literals in code blocks.
- Variables:
{{@and@}} - Blocks:
{%@and@%}
Standard Jinja2 { { } } syntax will NOT work.
Using Variables¶
Variables are defined in docs/variables.yaml:
# docs/variables.yaml
project_name: FreeCAD Robust MCP Suite
package_name: freecad-robust-mcp
xmlrpc_port: 9875
socket_port: 9876
Use in Markdown:
Available Variables¶
| Variable | Value | Description |
|---|---|---|
project_name | FreeCAD Robust MCP Suite | Display name |
package_name | freecad-robust-mcp | PyPI package name |
docker_image | spkane/freecad-robust-mcp | Docker image |
xmlrpc_port | 9875 | XML-RPC server port |
socket_port | 9876 | Socket server port |
paths.macos.macro | ~/Library/... | macOS macro path |
paths.linux.macro | ~/.local/share/... | Linux macro path |
paths.windows.macro | %APPDATA%/... | Windows macro path |
Built-in Macros¶
API Documentation (mkdocstrings)¶
Auto-generate API docs from Python docstrings:
This renders the module's docstrings, classes, and functions automatically.
Options:
show_source: true- Show source codeheading_level: 3- Start headings at h3members: [func1, func2]- Only show specific membersfilters: ["!^_"]- Exclude private members
Navigation¶
Features Enabled¶
- Instant navigation - Pages load without full refresh
- Navigation tabs - Top-level sections as tabs
- Section index pages - Click section to see overview
- Back to top - Button appears when scrolling
- Table of contents - Follows scroll position
Images¶
Basic Image¶
Image with Caption¶
<figure markdown>

<figcaption>This is the caption</figcaption>
</figure>
Image Alignment¶
Image Size¶
Links¶
Internal Links¶
[Installation Guide](../getting-started/installation.md)
[Config section](configuration.md#environment-variables)
External Links¶
External links automatically open in new tab (Material theme default).
Tables¶
Standard Markdown tables with sorting enabled:
| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| Data 1 | Data 2 | Data 3 |
| Data 4 | Data 5 | Data 6 |
File Structure¶
docs/
├── index.md # Home page
├── variables.yaml # Macros variables
├── overrides/ # Theme customizations
│ └── .gitkeep
├── assets/ # Images, favicon, etc.
├── getting-started/
│ ├── installation.md
│ ├── configuration.md
│ └── quickstart.md
├── guide/
│ └── ...
├── api/
│ └── ...
└── development/
├── contributing.md
├── architecture.md
├── releasing.md
└── mkdocs-guide.md # This file
Common Tasks¶
Adding a New Page¶
- Create the markdown file in the appropriate directory
- Add to
nav:section inmkdocs.yaml
Adding Redirects¶
If you move/rename a page, add a redirect in mkdocs.yaml:
Custom CSS¶
Add custom styles in docs/overrides/stylesheets/extra.css and reference in mkdocs.yaml:
Custom JavaScript¶
Add scripts in docs/overrides/javascripts/extra.js and reference in mkdocs.yaml:
Troubleshooting¶
Macros Not Rendering¶
Remember to use custom delimiters: {{ variable }} not {{ variable }}.
Git Revision Date Warnings¶
New files not yet committed will show warnings. Commit the file to fix.
Build Errors¶
Serve Not Auto-Reloading¶
Some changes (like mkdocs.yaml) require restarting the server.