Skip to content

About

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

ccpbiosim-sphinx-theme

Category Badges
Build PR Checks Weekly Tests
Documentation Weekly Docs Docs - Status
PyPI PyPI - Version PyPI - Python Version
Quality Coverage Status

The Sphinx theme used across CCPBioSim projects. It is built on pydata-sphinx-theme and uses the same colours as ccpbiosim.org.

An example site using the theme is available at ccpbiosim-sphinx-theme.readthedocs.io.

Installation

Add the theme to your docs requirements:

ccpbiosim-sphinx-theme>=1.0,<2.0

Usage

Set the theme in conf.py:

html_theme = "ccpbiosim_sphinx_theme"
html_context = {"github_repo": "my-project"}

This adds the CCPBioSim header, footer and colours, the GitHub link and the "Edit on GitHub" buttons. sphinx-design and sphinx-copybutton are enabled by the theme, so they do not need adding to extensions.

If conf.py is in docs/ rather than docs/source/, also set "doc_path": "docs" in html_context. Anything set in html_theme_options or html_context takes priority over the theme defaults.

To add a banner to the home page, put this under the page title:

.. ccpbiosim-hero::
   :logo-light: _static/logo-black-text.svg
   :logo-dark: _static/logo-white-text.svg
   :tagline: A short description of the project
   :button: installation | Get started
   :github: CCPBioSim/my-project

The logo changes with light and dark mode. To use a single logo on a dark navy banner instead, use :logo: with a logo that has white text.

Development

pip install -e ".[testing,pre-commit]"
pytest

Releasing

Releases are made by running the Release ccpbiosim-sphinx-theme workflow from the Actions tab. This updates the version, tags the release and publishes it to PyPI.

Projects use any 1.x release automatically, so use a minor or patch release for changes that should reach every project. Use a new major version for changes that need projects to update their conf.py.

Contact Information

For questions or problems, please contact CCPBIOSIM@stfc.ac.uk.

About

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages