The CheckTick documentation system automatically discovers and organizes all markdown files in the docs/ folder.
How It Works
YAML Frontmatter (Required)
All documentation files MUST include YAML frontmatter at the top with title and category fields. Files without proper frontmatter will not appear in the documentation.
---
title: My Feature Guide
category: features
priority: 5
---
Your documentation content starts here...
Required Fields:
title(required): The display title in navigation and page headercategory(required): Which section to display in- Must match one of the valid categories listed below
- Set to
Noneto hide from sidebar while keeping the page accessible via URL
Optional Fields:
priority(optional): Sort order within category (lower numbers appear first)- Default: 999 (appears at end)
- Example: priority 1 appears before priority 5
Valid Categories:
getting-started- Getting Started guidesfeatures- Feature documentationself-hosting- Self-hosting guidesconfiguration- Configuration guidessecurity- Security documentationdata-governance- Data governance guidesapi- API & development docstesting- Testing guidesinternationalization- i18n documentationgetting-involved- Contributing guidesNone- Hide from menu (accessible via URL only)
Example:
---
title: Getting Started
category: getting-started
priority: 1
---
Welcome to CheckTick! This guide will help you get started...
Auto-Discovery
Simply add a new .md file to the docs/ folder with proper YAML frontmatter and it will automatically appear in the documentation navigation. No code changes needed!
Example:
# Add a new guide
touch docs/my-new-feature.md
# Edit the file with YAML frontmatter and content
cat > docs/my-new-feature.md << 'EOF'
---
title: My New Feature
category: features
priority: 10
---
This is a guide to using my new feature...
EOF
# Restart the web container
docker compose restart web
# The page will now appear in the docs!
Important: Files without proper YAML frontmatter will be ignored and will not appear in the documentation.
Manual Overrides
If you need more control over specific pages (e.g., including files from outside the docs/ folder), you can override settings in checktick_app/core/views.py:
Custom Page Configuration
Edit the DOC_PAGE_OVERRIDES dictionary:
DOC_PAGE_OVERRIDES = {
"my-special-doc": {
"file": "my-special-doc.md",
"category": "api",
"title": "Custom Display Title",
},
}
External Files
You can include files from outside the docs/ folder:
DOC_PAGE_OVERRIDES = {
"changelog": {
"file": REPO_ROOT / "CHANGELOG.md",
"category": "features",
"title": "Changelog",
},
}
New Categories
Add new categories in the DOC_CATEGORIES dictionary:
DOC_CATEGORIES = {
"my-category": {
"title": "My Custom Category",
"order": 10, # Controls display order
"icon": "๐ฏ", # Optional emoji icon
},
}
Best Practices
1. Always Use YAML Frontmatter
Start every documentation file with YAML frontmatter:
---
title: Clear Descriptive Title
category: features
priority: 5
---
Your content here...
This ensures consistent display and proper organization.
2. Hide Supporting Documentation
Use category: None for detailed reference pages that should be accessible but not clutter the main menu:
---
title: Advanced Technical Details
category: None
---
This page is accessible via direct link but won't appear in sidebar.
Link to these pages from main documentation pages.
3. Use Priority for Logical Ordering
Within each category, use priority to control the order:
# In getting-started.md
---
title: Getting Started
category: getting-started
priority: 1
---
# In getting-started-api.md
---
title: Getting Started with API
category: getting-started
priority: 2
---
Lower priority values appear first in the menu.
4. Descriptive Filenames
Use descriptive, kebab-case filenames:
- โ
datasets-and-dropdowns.md
- โ
authentication-and-permissions.md
- โ doc1.md
- โ README.md (reserved for index)
5. Clear Titles
Use clear, concise titles in frontmatter:
- โ
title: Getting Started
- โ
title: API Reference
- โ title: Docs
- โ title: Untitled Document
6. Consistent Naming Patterns
Use consistent prefixes for related docs:
- self-hosting.md (priority: 1)
- self-hosting-quickstart.md (priority: 2)
- self-hosting-configuration.md (priority: 3)
This helps organize related documentation together in the same category.
Linking Between Documentation Pages
When linking from one documentation page to another, always use the /docs/slug/ URL format, not the .md file extension.
โ Correct Link Format
See the [Bulk Survey Import](/docs/import/) for details.
Check [Authentication & Permissions](/docs/authentication-and-permissions/) guide.
Read about [Collections](/docs/collections/) for repeatable questions.
โ Incorrect Link Format
See the [Bulk Survey Import](import.md) for details. <!-- Will 404 -->
Check [Authentication](../authentication-and-permissions.md) guide. <!-- Won't work -->
How It Works
- The slug is the filename without the
.mdextension - URLs follow the pattern:
/docs/<slug>/ - Django handles the routing and markdown rendering
- Links work correctly in both development and production
Examples
| Markdown File | Slug | URL |
|---|---|---|
import.md |
import |
/docs/import/ |
authentication-and-permissions.md |
authentication-and-permissions |
/docs/authentication-and-permissions/ |
api-datasets.md |
api-datasets |
/docs/api-datasets/ |
self-hosting-quickstart.md |
self-hosting-quickstart |
/docs/self-hosting-quickstart/ |
Finding the Correct Slug
- Look at the filename in
docs/folder - Remove the
.mdextension - Use the result as the slug in
/docs/slug/
Navigation Structure
The documentation sidebar is organized hierarchically:
Documentation
โโโ ๐ Getting Started
โ โโโ Getting Started
โ โโโ Getting Started Api
โโโ โจ Features
โ โโโ Collections
โ โโโ Groups View
โ โโโ Surveys
โโโ โ๏ธ Configuration
โ โโโ Branding And Theme Settings
โ โโโ User Management
โโโ ๐ Security
โ โโโ Authentication And Permissions
โ โโโ Patient Data Encryption
โโโ ๐ง API & Development
โ โโโ Adding External Datasets
โ โโโ Api
โโโ ๐งช Testing
โ โโโ Testing Api
โ โโโ Testing Webapp
โโโ ๐ Internationalization
โ โโโ I18n
โ โโโ I18n Progress
โโโ ๐ Other
โโโ Releases
Categories are sorted by their order value (lower numbers appear first).
Troubleshooting
Page Not Appearing
- Check the filename: Must be
.mdextension - Restart the container:
docker compose restart web - Check for errors:
docker compose logs web | grep -i error
Wrong Category
- Check filename patterns in
_infer_category()function - Add manual override in
DOC_PAGE_OVERRIDES - Update filename to include category keywords
Custom Title Not Showing
- Check the first line starts with
#(must have space after #) - Verify markdown syntax is correct
- Add manual title override in
DOC_PAGE_OVERRIDES
Implementation Details
The system consists of three main components:
_discover_doc_pages(): Scansdocs/folder and builds page registry_infer_category(): Categorizes pages based on filename patterns_nav_pages(): Builds categorized navigation structure for templates
This runs once at Django startup, so changes require a container restart.
Migration from Old System
The old system required manually updating the DOC_PAGES dictionary. The new system is backward compatible:
- Old manual entries moved to
DOC_PAGE_OVERRIDES - All existing docs auto-discovered
- No changes needed to existing markdown files
Future Enhancements
Potential improvements:
- Frontmatter support: Add YAML metadata to markdown files for explicit categorization
- Hot reload: Auto-discover without container restart (development mode)
- Search: Full-text search across all documentation
- Related pages: Suggest related documentation based on content
- Breadcrumbs: Show navigation path for nested topics
Related Files
checktick_app/core/views.py- Documentation discovery logicchecktick_app/core/templates/core/docs.html- Navigation templatechecktick_app/core/urls.py- URL routing for docsdocs/README.md- Documentation index page