Contributing to documentation¶
This guide explains how to build and contribute to the HED schemas documentation.
Prerequisites¶
Python 3.10 or higher
Git
Setting up your environment¶
Clone the repository:
git clone https://github.com/hed-standard/hed-schemas.git cd hed-schemas
Building documentation locally¶
Initial setup (one-time)¶
Create a virtual environment (if not already done):
Windows:
python -m venv .venv .venv\Scripts\Activate.ps1
Unix/Mac:
python -m venv .venv source .venv/bin/activate
Install documentation dependencies:
pip install -r docs/requirements.txt
Building with Sphinx¶
Navigate to the docs directory and build the documentation:
Windows:
cd docs
python -m sphinx -b html source _build/html
Unix/Mac:
cd docs
python -m sphinx -b html source _build/html
The built documentation will be in docs/_build/html/.
Viewing documentation locally¶
After building, you can serve the documentation with Python’s built-in HTTP server:
Windows:
cd docs/_build/html
python -m http.server 8000
Unix/Mac:
cd docs/_build/html
python -m http.server 8000
Then open your browser to http://localhost:8000.
Press Ctrl+C to stop the server.
Alternative: You can also open docs/_build/html/index.html directly in your web browser.
Making changes to documentation¶
Documentation structure¶
The documentation source files are in docs/source/:
File |
Purpose |
|---|---|
|
Main documentation index |
|
Overview of HED schemas |
|
Guide for using schemas |
|
Guide for schema development |
|
Detailed schema information |
|
Repository structure reference |
|
Sphinx configuration |
Workflow for documentation changes¶
Create a branch:
git checkout -b admin_update_docs
Edit documentation files in
docs/source/Use Markdown (
.md) for content pagesUse reStructuredText (
.rst) for structural files
Build and preview:
# Build cd docs python -m sphinx -b html source _build/html # Serve cd _build/html python -m http.server 8000
Review your changes in the browser at http://localhost:8000
Rebuild as needed - The build is fast, so rebuild frequently to check your changes
Commit and push:
git add docs/source/ git commit -m "Update documentation" git push origin admin_update_docs
Create a pull request on GitHub
Documentation style guide¶
Markdown guidelines¶
Use
#for top-level headings,##for sections,###for subsectionsUse code blocks with language specification:
python`,bash`, etc.Use bold for emphasis on key terms
Use
inline codefor commands, file names, and code snippetsUse bullet lists for unordered items
Use numbered lists for sequential steps
Code examples¶
Always specify the language for code blocks:
```python
from hed import schema
schema = schema.load_schema('8.4.0')
```
For PowerShell commands:
```powershell
pip install -r requirements-dev.txt
```
Links¶
Internal links (to other documentation pages):
See the [Developer Guide](developer_guide.md) for more information.
External links:
Visit the [HED Schema Browser](https://www.hedtags.org/hed-schema-browser)
File links (use relative paths from docs root):
[Repository Structure](../../README.md)
Common tasks¶
Adding a new page¶
Create a new
.mdfile indocs/source/Add it to the
toctreeinindex.rst:.. toctree:: :maxdepth: 2 :caption: Contents: introduction user_guide your_new_page
Build and verify it appears in the navigation
Updating schema information¶
When a new schema version is released:
Update version numbers in
schemas_reference.mdAdd new links for the new version
Update the version table in
introduction.mdCheck that all DOI links are correct
Adding images¶
Place images in
docs/source/_static/images/Reference in Markdown:

Troubleshooting¶
Build errors¶
Problem: Module not found errors
ModuleNotFoundError: No module named 'myst_parser'
Solution: Reinstall dependencies
pip install -r docs/requirements.txt
Warnings¶
Sphinx may show warnings about:
Missing references
Duplicate labels
Malformed links
Fix these warnings before committing - they indicate potential broken links or incorrect formatting.
Port already in use¶
Problem: Address already in use when running http.server
Solution: Use a different port
python -m http.server 8001
Or find and stop the process using port 8000.
CI/CD integration¶
Documentation is automatically built and deployed:
On every push to main: Documentation is built and deployed to GitHub Pages
On pull requests: Documentation is built (but not deployed) to verify no errors
The deployed documentation is available at the GitHub Pages URL for the repository.
Getting help¶
Documentation issues: Post on GitHub Issues
Questions: Email hed.maintainers@gmail.com
Sphinx help: Sphinx documentation
MyST (Markdown) help: MyST documentation