Skip to content

Commit

Permalink
docs: Fix issue in readthedocs locating theme.
Browse files Browse the repository at this point in the history
Error:
    NameError: name 'html_theme' is not defined

Also fixes a couple of issues highlighted by the sphinx build
output.
  • Loading branch information
microbit-carlos committed Feb 22, 2024
1 parent 3dfe51f commit 3a93717
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
10 changes: 2 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx_rtd_theme',
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -339,16 +340,9 @@
# If false, no index is generated.
#epub_use_index = True


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'http://docs.python.org/': None}

# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_theme = 'sphinx_rtd_theme'

# otherwise, readthedocs.org uses their theme by default, so no need to specify it
1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ Projects related to MicroPython on the BBC micro:bit include:
:maxdepth: 2
:caption: Developer Guide

devguide/installation
devguide/flashfirmware
devguide/repl
devguide/hexformat
Expand Down
1 change: 1 addition & 0 deletions docs/neopixel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ art and games such as the demo shown below.

.. image:: neopixel.gif
:alt: Neopixel flexible tile

Image attribution: `adafruit flexible Neopixel matrix <https://www.adafruit.com/product/2547>`_

To connect a strip of neopixels you'll need to attach the micro:bit as shown
Expand Down
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sphinx<8
sphinx_rtd_theme<2

0 comments on commit 3a93717

Please sign in to comment.