Contributing¶
This project follows the Read the Docs code of conduct. If you are not familiar with our code of conduct policy, take a minute to read the policy before starting with your first contribution.
Modifying the theme¶
The styles for this theme use Wyrm. We use Webpack is used to watch for changes, rebuild the static assets, and rebuild the Sphinx demo documentation.
Note
The installation of Node is outside the scope of this documentation. You will need Node version 10+ in order to make changes to this theme.
Set up your environment¶
Install Sphinx and documentation build dependencies.
$ pip install -e '.[dev]'
Install node-sass, and theme dependencies locally.
$ npm install
Making changes¶
Changes to the theme can be compiled and tested with Webpack:
$ npm run dev
This script will do the following:
Install and update any dependencies.
Build the static CSS from SASS source files.
Build the demo documentation.
Watch for changes to the SASS files and documentation and rebuild everything on any detected changes.
Alternatively, if you don’t need to watch the files, the release build script can be used to test built assets:
$ npm run build
Translations¶
Translations are managed using Transifex. You can join any of the existing language teams or request a new language is added to the project. For more information on our translation standards, see our docs on Internationalization
Periodically, core team should update the translation files outside our normal releases. Someone from the core team, with write access to Transifex, should run the following:
$ python setup.py update_translations
This will extract new messages, upload the messages to Transifex, and will update our local translation files. Changes can be checked in to a branch and put up for review.
Releasing the theme¶
To release a new version of the theme, core team will take the following steps:
Bump the version by running
bump2version [major|minor|patch|dev]
. This will automatically increase the correct part(s) of the version number, you do not need to specify the exact version number. We follow PEP440 (with regards to alpha release and development versions). The version increment should reflect these releases and any potentially breaking changes.New versions are by default
alpha
releases. If this is a release candidate, runbump2version --allow-dirty release
to update the release to anrc
release. If this is a final release, run the command again.Update the changelog (
docs/changelog.rst
) with the version information.Run
python setup.py update_translations
to compile new translation files and update Transifex.Run
python setup.py build_assets
to rebuild all the theme assets and the Python package.Commit these changes.
Tag the release in git:
git tag $NEW_VERSION
.Push the tag to GitHub:
git push --tags origin
.Upload the package to PyPI:
$ rm -rf dist/ $ python setup.py sdist bdist_wheel $ twine upload --sign --identity [email protected] dist/*