Skip to content

Commit e2f9497

Browse files
committed
Merging branch/2023-02-22/manual-rtd-theme for GitHub pull request #166 <#166>.
2 parents 554513b + ebeee66 commit e2f9497

7 files changed

Lines changed: 644 additions & 584 deletions

File tree

manual/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,10 @@ doctest: $(SPHINXBUILD)
159159
"results in $(BUILDDIR)/doctest/output.txt."
160160

161161
.PHONY: tools
162-
tools: tool/bin/pip requirements.pip
163-
tool/bin/pip install -r requirements.pip
162+
tools: $(SPHINXBUILD)
164163

165-
tool/bin/sphinx-build: tools
164+
$(SPHINXBUILD): tool/bin/pip requirements.pip
165+
tool/bin/pip install -r requirements.pip
166166

167167
tool/bin/pip:
168168
$(PYTHON) -mvenv tool

manual/requirements.pip

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# manual/requirements.txt -- MPS manual build requirements for pip
1+
# manual/requirements.pip -- MPS manual build requirements for pip
22

3-
# Layout breaks in Sphinx >= 5. See <https://github.com/Ravenbrook/mps/issues/121>.
4-
sphinx >= 4, < 5
3+
sphinx
4+
sphinx-rtd-theme
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{# manual/source/_templates/layout.html -- add index to manual sidebar.
2+
#
3+
# See https://stackoverflow.com/a/37843854 .
4+
#}
5+
6+
{% extends "!layout.html" %}
7+
8+
{% block menu %}
9+
{{ super() }}
10+
11+
<p class="caption" role="heading">
12+
<span class="caption-text">Indices and tables</span>
13+
</p>
14+
15+
<ul>
16+
17+
{# The class toctree-l1 seems to correspond to list items generated
18+
by a Sphinx toctree directive that are at depth 1. I have not
19+
found documented confirmation of this but it is confirmed
20+
`_toctree_add_classes
21+
<https://github.com/sphinx-doc/sphinx/blob/bb74aec2b6aa1179868d83134013450c9ff9d4d6/sphinx/environment/adapters/toctree.py#L403-L430>`_
22+
in the Sphinx source code. If the list layout goes wonky, this
23+
might be to blame. RB 2023-10-20. #}
24+
25+
<li class="toctree-l1">
26+
27+
<a class="reference internal" href="{{pathto('genindex.html', 1)}}">Index</a>
28+
29+
{# Module index and search page aren't used in the MPS manual but
30+
might be in future. This is how they might be added. #}
31+
32+
{# <a class="reference internal" href="{{pathto('modindex.html', 1)}}">Module Index</a> #}
33+
34+
{# <a class="reference internal" href="{{pathto('search.html', 1)}}">Search Page</a> #}
35+
36+
</li>
37+
38+
</ul>
39+
40+
{% endblock %}

manual/source/conf.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,17 @@
3737
else:
3838
project = u'Memory Pool System'
3939
master_doc = 'index'
40-
html_theme = 'mps'
40+
# We use the Read the Docs theme for Sphinx for smooth publishing
41+
# at readthedocs.io, low maintenance overheads, local search, etc.
42+
# See primarily `GitHub issue #98
43+
# <https://github.com/Ravenbrook/mps/issues/98>`_ but also `GitHub
44+
# issue #121 <https://github.com/Ravenbrook/mps/issues/121>`_ .
45+
# See <https://sphinx-rtd-theme.readthedocs.io/> for theme
46+
# documentation.
47+
html_theme = 'sphinx_rtd_theme'
48+
html_theme_options = {
49+
'includehidden': False,
50+
}
4151
html_sidebars = {
4252
'**': ['localtoc.html', 'relations.html', 'links.html', 'contact.html'],
4353
}

0 commit comments

Comments
 (0)