Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ Theme Usage
-----------

Install with `pip install sphinx-rtd-light-dark`. Then in your `conf.py` file,
add the entry ``'sphinx_rtd_light_dark'`` to the `extensions` list,
and set `html_theme` to ``'sphinx_rtd_light_dark'``.
add the entry ``'ultraplot_theme'`` to the `extensions` list,
and set `html_theme` to ``'ultraplot_theme'``.
The legacy extension/theme name ``'sphinx_rtd_light_dark'`` remains supported.

Example `conf.py`:

```python
extensions = [
...
'sphinx_rtd_light_dark',
'ultraplot_theme',
...
]
html_theme = 'sphinx_rtd_light_dark'
html_theme = 'ultraplot_theme'
```
10 changes: 7 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,19 @@ project_urls =
Source Code = https://github.com/lukelbd/sphinx_rtd_light_dark

[options]
packages = sphinx_rtd_light_dark
packages =
sphinx_rtd_light_dark
ultraplot_theme
setup_requires = setuptools>=44; toml; setuptools_scm>=3.4.3
install_requires = pygments; sphinx_rtd_theme>=2.0.0
include_package_data = True
python_requires = >=3.6.0

[options.package_data]
sphinx.sphinx_rtd_light_dark = theme.conf, static/*.css, static/*.js
sphinx_rtd_light_dark = theme.conf, static/*.css, static/*.js, static/pygments/*.css, layout.html, breadcrumbs.html
ultraplot_theme = static/*.css, static/*.js

[options.entry_points]
sphinx.html_themes =
name_of_theme = sphinx_rtd_light_dark
sphinx_rtd_light_dark = sphinx_rtd_light_dark
ultraplot_theme = ultraplot_theme
3 changes: 3 additions & 0 deletions sphinx_rtd_light_dark/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
A clean variant on the read the docs theme with light mode dark mode toggling.
"""
import os

from pygments.formatters import HtmlFormatter

# Declare themes. These should be kept updated with custom.js
Expand All @@ -26,4 +27,6 @@
# Add entrypoint for theme
# See: https://www.sphinx-doc.org/en/master/development/theming.html
def setup(app): # noqa: E302
# Keep legacy name for compatibility and add canonical UltraPlot name.
app.add_html_theme('sphinx_rtd_light_dark', base)
app.add_html_theme('ultraplot_theme', base)
Loading