Skip to content

Commit 3740f77

Browse files
docs: Fix issue in readthedocs locating theme.
Error: NameError: name 'html_theme' is not defined Also fixes a couple of issues highlighted by the sphinx build output.
1 parent 3dfe51f commit 3740f77

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

docs/conf.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
'sphinx.ext.mathjax',
3838
'sphinx.ext.ifconfig',
3939
'sphinx.ext.viewcode',
40+
'sphinx_rtd_theme',
4041
]
4142

4243
# Add any paths that contain templates here, relative to this directory.
@@ -53,7 +54,7 @@
5354

5455
# General information about the project.
5556
project = u'BBC micro:bit MicroPython'
56-
copyright = u'2015-2022, Multiple authors'
57+
copyright = u'2015-2024, Multiple authors'
5758

5859
# The version info for the project you're documenting, acts as replacement for
5960
# |version| and |release|, also used in various other places throughout the
@@ -110,7 +111,7 @@
110111

111112
# The theme to use for HTML and HTML Help pages. See the documentation for
112113
# a list of builtin themes.
113-
# html_theme = 'default'
114+
html_theme = 'sphinx_rtd_theme'
114115

115116
# Theme options are theme-specific and customize the look and feel of a theme
116117
# further. For a list of options available for each theme, see the
@@ -342,13 +343,3 @@
342343

343344
# Example configuration for intersphinx: refer to the Python standard library.
344345
intersphinx_mapping = {'http://docs.python.org/': None}
345-
346-
# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
347-
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
348-
349-
if not on_rtd: # only import and set the theme if we're building docs locally
350-
import sphinx_rtd_theme
351-
html_theme = 'sphinx_rtd_theme'
352-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
353-
354-
# otherwise, readthedocs.org uses their theme by default, so no need to specify it

docs/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ Projects related to MicroPython on the BBC micro:bit include:
9393
:maxdepth: 2
9494
:caption: Developer Guide
9595

96-
devguide/installation
9796
devguide/flashfirmware
9897
devguide/repl
9998
devguide/hexformat

docs/neopixel.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ art and games such as the demo shown below.
2828

2929
.. image:: neopixel.gif
3030
:alt: Neopixel flexible tile
31+
3132
Image attribution: `adafruit flexible Neopixel matrix <https://www.adafruit.com/product/2547>`_
3233

3334
To connect a strip of neopixels you'll need to attach the micro:bit as shown

0 commit comments

Comments
 (0)