Markdown Style Guide¶
This guide explains the markdown syntax rules for this documentation site and how to avoid common formatting errors.
Why This Matters¶
Proper markdown syntax ensures that content renders correctly on the live site. The most common issue is missing blank lines before lists, which causes list items to display as run-on sentences instead of separate lines.
This project includes automated validation to catch these errors before they reach the live site.
Lists¶
Lists (ordered and unordered) must be preceded by a blank line when they follow other content.
Correct: Blank Line Before Lists¶
Result: List items render as separate, properly formatted lines.
Incorrect: No Blank Line¶
Result: The list runs together with the previous paragraph as a single line.
Headers and Lists¶
Always include a blank line between a header and a list.
Correct Example¶
Incorrect Example¶
Error: Missing blank line before unordered list
Bold Text and Lists¶
Include a blank line between bold text and lists.
Correct Example¶
Incorrect Example¶
Error: Missing blank line before ordered list
MkDocs Extensions¶
This site uses MkDocs Material theme with several extensions. These are valid syntax and will not trigger validation errors.
Admonitions¶
Admonitions create colored callout boxes:
!!! warning
This is a warning message.
- List items inside admonitions are fine
- No blank line needed here
!!! info "Custom Title"
This is an info box with a custom title.
Types: note, info, tip, warning, danger, success
Code Blocks¶
Code blocks are created with triple backticks:
Definition Lists¶
Definition lists use colons:
Footnotes¶
Validation¶
Running Validation Locally¶
Before committing changes, run validation to catch errors:
# Validate all markdown files in docs/ directory
python scripts/markdown/validate_markdown.py docs/ --verbose
# See detailed output
python scripts/markdown/validate_markdown.py docs/ --output text --verbose
Exit Codes¶
0- Validation passed (no errors)1- Validation failed (errors found)
Output Formats¶
# Human-readable text (default)
python scripts/markdown/validate_markdown.py docs/ --output text
# JSON format (for tooling)
python scripts/markdown/validate_markdown.py docs/ --output json
# GitHub Actions format (used in CI)
python scripts/markdown/validate_markdown.py docs/ --output github
Fixing Errors¶
Automated Correction¶
The project includes a tool to automatically fix list spacing errors:
# Preview changes without modifying files
python scripts/markdown/fix_list_spacing.py docs/ --dry-run
# Apply fixes with backup files created
python scripts/markdown/fix_list_spacing.py docs/ --backup
# Apply fixes without backup
python scripts/markdown/fix_list_spacing.py docs/ --no-backup
Manual Correction¶
When you see a validation error:
Error message:
Fix: Open the file and add a blank line before the list at line 15.
Common Errors¶
Error 1: Missing Blank Before Ordered List¶
Error:
Cause:
Fix:
Error 2: Missing Blank Before Unordered List¶
Error:
Cause:
Fix:
Error 3: Paragraph to List Transition¶
Cause:
Fix:
CI/CD Integration¶
All pull requests automatically run validation checks. If validation fails:
- The build will fail and show error details
- GitHub will show annotations on the specific lines with errors
- The PR cannot be merged until errors are fixed
Example annotation:
Tips for Success¶
- Preview locally: Run
mkdocs serveto preview your changes before committing - Validate before commit: Run the validation script to catch errors early
- Check the live site: After deployment, verify that lists render correctly
- Use the fix tool: For bulk changes, the automated fix tool saves time
Getting Help¶
If you encounter validation errors you don't understand:
- Check this guide for common error patterns
- Look at existing documentation files for examples
- Run the fix tool to see what changes are suggested
- Ask for help in the repository issues or discussions
Quick Reference¶
| Situation | Need Blank Line? |
|---|---|
| Header → List | ✅ Yes |
| Paragraph → List | ✅ Yes |
| Bold text → List | ✅ Yes |
| List item → List item | ❌ No (continuation) |
| Code block → List | ✅ Yes |
| Inside admonition | ❌ No (special context) |
Remember: When in doubt, add a blank line before lists!