Contribution guide¶
Thank you for your interest in contributing to the Ulwazi Sphinx theme! This guide will help you get started with building, testing, and developing the theme.
Prerequisites¶
sudo apt install npm
sudo npm install -g corepack
Setup¶
Install Node.js dependencies (if you don’t have a
node_modulesdirectory):yarn installBuild the sample documentation with the theme:
make docsThis sets up a virtual environment, installs dependencies, and builds the sample docs.
You can rebuild the theme manually, which is especially useful if you make significant theme changes outside of the docs content:
make rebuild
This does a clean build, which may be necessary after changes to the theme files.
Reset the environment¶
Some changes to the environment (for example, if you add a new package to pyproject.toml)
may require a complete reset by deleting the virtual environment. To reset the virtual environment:
Delete the
.venvfolder manually or run:make cleanBuild the documentation from scratch with
build docs.
Rebuild CSS¶
To rebuild the theme/ulwazi/static/css/vanilla-main.css css file after
making any changes to the SCSS files it consists of:
make vanilla-main
Theme files layout¶
The following list contatins some of the most important files and folders to focus on for contributing to this theme:
ulwazi/__init__.py– Theme initialization and core hooksulwazi/navigation.py– Manages the global TOC navigation treeulwazi/theme/ulwazi/– Contains all theme files:theme.toml– Theme configurationstatic/– Static assets (CSS, JS, images)HTML files – Jinja templates used by Sphinx (look for
.htmlfiles)
Other files of interest for development:
ulwazi/product_menu_gen.py– Product menu generation logiculwazi/tests/– Automated tests for the theme
HTML customization¶
To modify the HTML of pages generated by Sphinx (before the theme is applied),
see the _html_page_context function in ulwazi/__init__.py.
Further resources¶
All contributions are welcome: bug reports, feature requests, and pull requests.