Documentation¶
We use Sphinx for DrumScript documentation. We use the Shibuya Sphinx theme for layout.
DrumScript documentation structure¶
See here and below
DrumScript Documentation Structure
==================================
This folder contains the source files for the DrumScript Sphinx documentation website.
Key Folders:
------------
/guide -> User-focused tutorials (Installation, Usage).
/theory -> Explanations, Background Science, and Notation Guides.
/images -> PNG/JPG assets for theory pages.
/development -> Guides for code contributors (Testing, Code of Conduct).
/release_notes -> Documentation related to `DrumScript` releases.
/_static -> Website assets (Logos, Custom CSS).
/_build -> The output folder (Generated HTML lives here).
Key Files:
----------
index.md -> The Homepage (Table of Contents).
conf.py -> Sphinx Configuration (Theme, Plugins).
api.rst -> Auto-generated Python API Reference.
Setup your development environment¶
Clone DrumScript repo
Use
git checkout -b feature/update_sphinx_docs. Github will switch you to thefeature/update_sphinx_docsbranch. NOTE:feature/update_sphinx_docsis indicative of branch name. Please always use a subfolder, iebuild/,2.1.x/,feature/etc depending on your changesUse
git push origin -u feature/update_sphinx_docsto publish your branch to the remote originActivate
.venvusingsource .venv/bin/activate, then typeuv pip install -e ".[dev]"to install the sphinx packages
You can deactivate your
.venvanytime from the root folder ofDrumScriptusingdeactivate
Start making changes. Once you push a change, raise a PR. CODEOWNERS will automatically be assigned to review once the PR is ready for review.
About testing the documentation¶
Always test local rendering before submitting changes for review in your PR.
There are three main files that we use to amend the Sphinx documentation:
docs/conf.py: Configures the Shibuya theme. Use this to define how Sphinx builds the layout, amend navbar links.docs/index.md: Sets up the structure of thedocumentation/subfoldersdocs/api.rst: Recursively obtains functions and arguments to post underAPI referenceon the documentation
Images are stored in docs/_static.
How to re-build the documentation¶
cd docsrm -rf _buildmake html: a short way of executing the full commandpython -m sphinx -b html -d _build/doctrees . _build/html. Check the output in your Terminal to verify the build and scan for errors.
Render locally (opens in browser)¶
Ensure you are in the root directory (
DrumScript/)open docs/_build/html/index.htmlOnce you are happy, commit the changes.