I just discovered that an RtD documentation set I maintain was experiencing this exact problem, where bullets would show on my local builds (accompanied by the ::marker
in the page source) but would be absent in RtD builds (no ::marker
in the page source).
I tried a couple of things that didn't work before finding this thread. Nick Crews's answer worked perfectly: I added the >=0.5.1
lower-bound constraint to the requirements-rtd.txt
file that I've configured RtD to use (I already had a Sphinx==5.3.0
pin, for reasons), and poof! I had my bullets back.
UPDATE 31 Jan 2023: Based on the comments in this sphinx_rtd_theme
GitHub issue, it's also important to be sure that the version of docutils
that gets installed is not too high. The thread recommends a constraint of docutils<0.17
, though in recent builds my bullets have rendered fine with docutils==0.17.1
.
This got me curious as to why it was necessary for me to add this constraint, when I'd already had sphinx-rtd-theme
declared in requirements-rtd.txt
.
On taking a closer look at my RtD build logs, I discovered that RtD has its own default-requirements install step, prior to installing anything I specify in my config. In this default install step, it was installing sphinx-rtd-theme<5.0
:
Collecting sphinx-rtd-theme<0.5
Downloading sphinx_rtd_theme-0.4.3-py2.py3-none-any.whl (6.4 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.4/6.4 MB 117.0 MB/s eta 0:00:00
Thus, when pip
hit the sphinx-rtd-theme
line in requirements-rtd.txt
, it just ignored it, because a version of it was already installed:
Successfully installed attrs-22.1.0 importlib-metadata-5.0.0 sphinx-5.3.0
sphinx-issues-3.0.1 sphinx-removed-in-0.2.1 sphinxcontrib-applehelp-1.0.2
sphinxcontrib-devhelp-1.0.2 sphinxcontrib-htmlhelp-2.0.0 sphinxcontrib-jsmath-1.0.1
sphinxcontrib-programoutput-0.17 sphinxcontrib-qthelp-1.0.3 zipp-3.10.0
Adding the >=0.5.1
constraint thus forces an upgrade/reinstall of sphinx-rtd-theme
to the latest version, fixing the problem.
So... where did this sphinx-rtd-theme<0.5
pin come from?
After digging into the RtD source for a while, I found out that there's a toggle for, essentially, "are we using the latest Sphinx version or not?":
# If defaulting to Sphinx 2+, we need to push the latest theme
# release as well. `<0.5.0` is not compatible with Sphinx 2+
self.project.get_feature_value(
Feature.USE_SPHINX_LATEST,
positive='sphinx-rtd-theme',
negative='sphinx-rtd-theme<0.5',
),
So, okaaay... I do want to use a recent version of Sphinx... why am I apparently set up to not USE_SPHINX_LATEST
?
Looks like it's a compatibility decision made at some point. Any RtD docset created before a certain date (20 Oct 2020, for a personal project like mine; or, 21 Jan 2021 for RtD for Business projects) is set as not USE_SPHINX_LATEST
. I assume these dates were picked for some strategic reason, likely having to do with in-the-wild usage of Sphinx < 2.0 dropping below some threshold.
Anyways! If you see a sphinx-rtd-theme<0.5
and/or sphinx<2
constraint in your RtD build logs, that's why. And, again, follow Nick Crews's advice to fix it.