Documentation Development Guide¶
This directory contains the comprehensive documentation for Citation Compass, built with Material for MkDocs.
๐ Documentation Structure¶
docs/
โโโ index.md # Homepage
โโโ getting-started/ # Installation and setup guides
โ โโโ installation.md
โ โโโ configuration.md
โ โโโ quick-start.md
โ โโโ environment-setup.md
โโโ user-guide/ # User documentation
โ โโโ overview.md
โ โโโ interactive-features.md
โ โโโ ml-predictions.md
โ โโโ network-analysis.md
โ โโโ notebook-pipeline.md
โ โโโ results-interpretation.md
โโโ developer-guide/ # Developer documentation
โ โโโ architecture.md
โ โโโ api-reference.md
โ โโโ database-schema.md
โ โโโ services-layer.md
โ โโโ testing.md
โ โโโ contributing.md
โโโ notebooks/ # Notebook documentation
โ โโโ overview.md
โ โโโ 01-comprehensive-exploration.md
โ โโโ 02-model-training-pipeline.md
โ โโโ 03-prediction-evaluation.md
โ โโโ 04-narrative-presentation.md
โโโ advanced/ # Advanced topics
โ โโโ custom-models.md
โ โโโ performance-optimization.md
โ โโโ integration-patterns.md
โ โโโ troubleshooting.md
โโโ api/ # API documentation
โ โโโ services.md
โ โโโ models.md
โ โโโ analytics.md
โ โโโ data.md
โโโ assets/ # Static assets
โ โโโ images/
โโโ overrides/ # Theme customization
โ โโโ main.html
โโโ includes/ # Reusable content
โโโ mkdocs.md
๐ Local Development¶
Prerequisites¶
Install documentation dependencies:
# Install MkDocs and Material theme
pip install -r docs-requirements.txt
# Or install from project dependencies
pip install -e ".[docs]" # If added to pyproject.toml
Development Server¶
Run the live development server:
# Start development server with live reload
mkdocs serve
# Start on custom port
mkdocs serve --dev-addr localhost:8001
# Enable strict mode (fails on warnings)
mkdocs serve --strict
The documentation will be available at http://localhost:8000 with: - โ
Live reload on file changes - โ
Navigation menu with full structure - โ
Search functionality across all content - โ
Interactive features like code copying
Building Documentation¶
Build static documentation:
# Build documentation site
mkdocs build
# Build with strict mode (recommended)
mkdocs build --strict
# Clean previous build
mkdocs build --clean
# Build to custom directory
mkdocs build --site-dir custom_site_dir/
๐จ Customization Guide¶
Theme Configuration¶
The main theme configuration is in mkdocs.yml:
theme:
name: material
palette:
# Light mode
- media: "(prefers-color-scheme: light)"
scheme: default
primary: blue grey
accent: deep orange
toggle:
icon: material/brightness-7
name: Switch to dark mode
# Dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: blue grey
accent: deep orange
toggle:
icon: material/brightness-4
name: Switch to light mode
Custom Styling¶
Additional styling is in docs/overrides/main.html:
- Academic theme colors with research-focused palette
- Enhanced code blocks with syntax highlighting
- Notebook-style cells for Jupyter integration
- Citation-specific styling for academic references
- Mobile responsive design optimizations
Adding New Content¶
1. Create New Pages¶
# Create new documentation page
touch docs/new-section/new-page.md
# Add to navigation in mkdocs.yml
nav:
- New Section:
- New Page: new-section/new-page.md
2. Page Template¶
Use this template for new pages:
# Page Title
Brief description of the page content and purpose.
## Overview
Explanation of what this page covers...
## Getting Started
Step-by-step instructions...
## Advanced Usage
More complex scenarios...
## Examples
Code examples with explanations...
## Troubleshooting
Common issues and solutions...
## Next Steps
Links to related documentation...
3. Add API Documentation¶
For Python API documentation using mkdocstrings:
# Module Title
Description of the module...
## Class or Function Name
::: path.to.module.ClassName
options:
show_root_heading: true
show_source: false
heading_level: 3
members:
- method1
- method2
๐ Writing Guidelines¶
Content Standards¶
- Clear Structure: Use consistent heading hierarchy
- Code Examples: Include practical, working examples
- Visual Elements: Use diagrams, screenshots, and interactive elements
- Cross-References: Link related sections and external resources
- Mobile-Friendly: Ensure content works on mobile devices
Markdown Extensions¶
The documentation supports advanced markdown features:
Admonitions¶
!!! tip "Pro Tip"
This is a helpful tip for users.
!!! warning "Important"
This is something users should be careful about.
!!! danger "Critical"
This is a critical warning.
Code Blocks with Highlighting¶
```python title="example.py" linenums="1"
def example_function():
"""Example with line numbers and title."""
return "Hello, World!"
Tabbed Content¶
=== "Python"
```python
print("Python example")
```
=== "JavaScript"
```javascript
console.log("JavaScript example");
```
Mermaid Diagrams¶
๐ง Configuration Reference¶
Core Settings¶
Key configuration options in mkdocs.yml:
# Site information
site_name: Citation Compass
site_description: Tools for academic citation analysis
site_url: https://citationcompass.barbhs.com
# Repository
repo_name: academic-citation-platform
repo_url: https://github.com/dagny099/citation-compass
# Theme configuration
theme:
name: material
features:
- navigation.instant # Single-page application
- navigation.tracking # URL updates with scroll
- navigation.tabs # Top-level sections as tabs
- navigation.sections # Group navigation items
- toc.follow # Follow table of contents
- search.highlight # Highlight search terms
Plugin Configuration¶
Essential plugins for the platform:
plugins:
- search: # Full-text search
separator: '[\s\-,:!=\[\]()"`/]+|\.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])'
- mkdocstrings: # API documentation from docstrings
handlers:
python:
paths: [src]
- git-revision-date-localized: # Show last update dates
enable_creation_date: true
Analytics and Tracking¶
extra:
analytics:
provider: google
property: !ENV GOOGLE_ANALYTICS_KEY
social:
- icon: fontawesome/brands/github
link: https://github.com/dagny099/citation-compass
๐ Performance Optimization¶
Build Optimization¶
- Minimize plugins - Only use necessary plugins
- Optimize images - Compress images in
assets/images/ - Enable caching - Use
--strictmode for production builds - Monitor build time - Track build performance
Search Optimization¶
- Custom separators - Improve search accuracy
- Search exclusions - Exclude generated content
- Index optimization - Configure search indexing
๐ Deployment¶
GitHub Pages¶
Deploy to GitHub Pages:
# Deploy to GitHub Pages
mkdocs gh-deploy
# Deploy with custom commit message
mkdocs gh-deploy --message "Update documentation"
# Deploy from specific directory
mkdocs gh-deploy --config-file custom-mkdocs.yml
Custom Domain¶
For custom domain deployment:
- Configure CNAME: Add
CNAMEfile todocs/directory - Update site_url: Set correct URL in
mkdocs.yml - Enable HTTPS: Configure SSL/TLS certificates
CI/CD Integration¶
Example GitHub Actions workflow:
name: Build Documentation
on:
push:
branches: [main]
paths: ['docs/**', 'mkdocs.yml']
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
- run: pip install -r docs-requirements.txt
- run: mkdocs build --strict
- run: mkdocs gh-deploy --force
๐ Quality Assurance¶
Pre-deployment Checklist¶
- All links work (internal and external)
- Code examples execute successfully
- Images display correctly
- Navigation structure is logical
- Search functionality works
- Mobile responsiveness verified
- Loading performance acceptable
- Cross-browser compatibility tested
Content Review¶
- Technical accuracy verified
- Writing clarity and consistency
- Code examples follow best practices
- Screenshots and diagrams up-to-date
- Accessibility guidelines followed
๐ค Contributing¶
Documentation Contributors¶
- Fork the repository
- Create feature branch for documentation changes
- Write following style guide and templates
- Test locally with
mkdocs serve - Submit pull request with clear description
Review Process¶
Documentation changes go through:
- Automated checks - Linting, link validation, build tests
- Peer review - Technical accuracy and clarity
- User testing - Usability and completeness
- Final approval - Maintainer review and merge
This documentation system provides a solid foundation for comprehensive, maintainable, and user-friendly platform documentation! ๐โจ