MAD4HATTER - Developer Documentation
This repository contains the MAD4HATTER amplicon sequencing pipeline and its documentation.
Documentation Development
This documentation site is built with MkDocs and the Material theme, and is automatically deployed to GitHub Pages via GitHub Actions.
Prerequisites
- Python 3.x
- pip
Local Development Setup
- Install dependencies:
pip install -r requirements.txt - Preview the site locally:
mkdocs serveThe site will be available at
http://127.0.0.1:8000/mad4hatter/ - Build the site (without serving):
mkdocs buildThe built site will be in the
site/directory (which is gitignored).
Documentation Structure
- Documentation source files: Located in the
docs/directory- Main pages:
docs/*.md - Module documentation:
docs/modules/ - Assets (images, CSS):
docs/assets/
- Main pages:
- Configuration:
mkdocs.ymlin the repository root - Custom styling:
docs/assets/css/custom.css
Adding or Editing Documentation
- Add a new page:
- Create a new Markdown file in
docs/or an appropriate subdirectory - Add it to the
navsection inmkdocs.yml
- Create a new Markdown file in
- Edit an existing page:
- Edit the corresponding
.mdfile indocs/ - Use
mkdocs serveto preview changes in real-time
- Edit the corresponding
- Update navigation:
- Edit the
navsection inmkdocs.yml - Follow the existing structure and indentation
- Edit the
- Add images:
- Place images in
docs/assets/images/ - Reference them using relative paths:

- Place images in
Writing Guidelines
- Use clear, concise language
- Include code examples where helpful
- Use MkDocs Material features:
- Admonitions (notes, warnings, tips) using
!!! note,!!! warning, etc. - Code blocks with syntax highlighting
- Tables for structured information
- Links to other documentation pages
- Admonitions (notes, warnings, tips) using
Deployment
The documentation is automatically deployed to GitHub Pages when changes are pushed to the main, master, or gh-pages branches.
The deployment is handled by the GitHub Actions workflow in .github/workflows/docs.yml.
GitHub Pages Configuration
- Go to repository Settings → Pages
- Under “Source”, select “GitHub Actions” (not “Deploy from a branch”)
- The workflow will automatically deploy on every push to the configured branches
Version Management (Optional)
If you want to maintain multiple versions of the documentation:
- Install mike:
pip install mike - Deploy a version:
mike deploy latest mike set-default latest - Deploy a specific version:
mike deploy 1.0.0
Manual Deployment
If you need to manually deploy (not recommended, as GitHub Actions handles this automatically):
mkdocs gh-deploy
This will build the site and push it to the gh-pages branch.
Testing Changes
Before committing documentation changes:
- Run
mkdocs serveand review all changes in the browser - Check that all links work correctly
- Verify images display properly
- Ensure the navigation structure makes sense
- Test on different screen sizes if possible
Dependencies
Documentation dependencies are listed in requirements.txt:
mkdocs>=1.5.0mkdocs-material>=9.0.0mkdocs-git-revision-date-localized-plugin>=1.2.0pymdown-extensions>=10.0mkdocs-minify-plugin>=0.7.0mike>=1.1.0
Contributing
When contributing to the documentation:
- Make changes in a feature branch
- Test locally with
mkdocs serve - Submit a pull request
- Documentation will be automatically deployed once merged to the main branch