Radiac.net Sphinx Theme
This Sphinx theme is a fork of the official `Read the Docs`_ theme, which adds:
- radiac.net colour scheme
- Top nav
Using in docs
Install:
pip install -e https://github.com/radiac/sphinx_radiac_theme.git
Add to conf.py
:
import sphinx_radiac_theme extensions = [ ... 'sphinx_radiac_theme', ] html_theme = "sphinx_radiac_theme"
Optional settings for conf.py
:
html_theme_options = { "radiac_project_slug": "projectslug", "radiac_project_name": "project name", "radiac_subsite_links": [ ('https://radiac.net/projects/projectslug/demo/', 'Demo'), ], }
Developing
Check out the project from git
Update
conf.py
as above, but add:html_theme_path = ["/path/to/sphinx_radiac_theme"]
Watch static and open the demo site in a browser:
nvm install nvm use npm install npm run dev
The upstream project does not currently use black, so take care to not apply auto-formatting to files which originate upstream.
Releasing a new version
Build static:
npm run build
Update the fork number in the version string in
setup.py
andsphinx_radiac_theme/__init__.py
Commit and push to
master
.
This project is not on pypi.
Merging from upstream
Pull into new branch:
git remote add upstream https://github.com/readthedocs/sphinx_rtd_theme.git git fetch upstream git checkout master git pull git checkout -b merge-upstream git merge upstream/master
Resolve any conflicts (ignoring
sphinx_radiac_theme/static
- we'll rebuild that). In particular, check for changes in these files:README.rst
- keep our versionsetup.*
,MANIFEST.in
- check for newsphinx_rtd_theme
setup.py
- update version (add.fork0
to upstream)sphinx_radiac_theme/__init__.py
- update version and check theme name issphinx_radiac_theme
src/sass/theme.sass
- make suretheme_variables
is followed byradiac_variables
andradiac_styles
is at the bottom- Updated
sphinx_radiac/theme/layout.html
fromsphinx_rtd_theme
, copying across theradiac_title
andradiac_nav
blocks sphinx_rtd_theme/*
- move files over tosphinx_radiac_theme
Test with:
npm install npm run dev
Rebuild and push:
npm run build git add . git commit git checkout master git merge merge-upstream git branch -d merge-upstream git push
More information
See original documentation for: