Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch the MPS manual to using the Read the Docs theme #166

Merged
merged 13 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from 12 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
6 changes: 3 additions & 3 deletions manual/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ doctest: $(SPHINXBUILD)
"results in $(BUILDDIR)/doctest/output.txt."

.PHONY: tools
tools: tool/bin/pip requirements.pip
tool/bin/pip install -r requirements.pip
tools: $(SPHINXBUILD)

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

tool/bin/pip:
$(PYTHON) -mvenv tool
6 changes: 3 additions & 3 deletions manual/requirements.pip
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# manual/requirements.txt -- MPS manual build requirements for pip
# manual/requirements.pip -- MPS manual build requirements for pip

# Layout breaks in Sphinx >= 5. See <https://github.com/Ravenbrook/mps/issues/121>.
sphinx >= 4, < 5
sphinx
sphinx-rtd-theme
40 changes: 40 additions & 0 deletions manual/source/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{# manual/source/_templates/layout.html -- add index to manual sidebar.
#
# See https://stackoverflow.com/a/37843854 .
#}

{% extends "!layout.html" %}

{% block menu %}
{{ super() }}

<p class="caption" role="heading">
<span class="caption-text">Indices and tables</span>
</p>

<ul>

{# The class toctree-l1 seems to correspond to list items generated
by a Sphinx toctree directive that are at depth 1. I have not
found documented confirmation of this but it is confirmed
`_toctree_add_classes
<https://github.com/sphinx-doc/sphinx/blob/bb74aec2b6aa1179868d83134013450c9ff9d4d6/sphinx/environment/adapters/toctree.py#L403-L430>`_
in the Sphinx source code. If the list layout goes wonky, this
might be to blame. RB 2023-10-20. #}

<li class="toctree-l1">

<a class="reference internal" href="{{pathto('genindex.html', 1)}}">Index</a>

{# Module index and search page aren't used in the MPS manual but
might be in future. This is how they might be added. #}

{# <a class="reference internal" href="{{pathto('modindex.html', 1)}}">Module Index</a> #}

{# <a class="reference internal" href="{{pathto('search.html', 1)}}">Search Page</a> #}

</li>

</ul>

{% endblock %}
12 changes: 11 additions & 1 deletion manual/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,17 @@
else:
project = u'Memory Pool System'
master_doc = 'index'
html_theme = 'mps'
# We use the Read the Docs theme for Sphinx for smooth publishing
# at readthedocs.io, low maintenance overheads, local search, etc.
# See primarily `GitHub issue #98
# <https://github.com/Ravenbrook/mps/issues/98>`_ but also `GitHub
# issue #121 <https://github.com/Ravenbrook/mps/issues/121>`_ .
# See <https://sphinx-rtd-theme.readthedocs.io/> for theme
# documentation.
html_theme = 'sphinx_rtd_theme'
html_theme_options = {
'includehidden': False,
}
html_sidebars = {
'**': ['localtoc.html', 'relations.html', 'links.html', 'contact.html'],
}
Expand Down
Binary file modified manual/source/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions manual/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Memory Pool System
##################
Contents
********

.. toctree::
:caption: Memory Pool System
:maxdepth: 2

guide/index
Expand All @@ -10,11 +11,8 @@ Memory Pool System
design/index
design/old


Appendices
##########

.. toctree::
:caption: Appendices
:maxdepth: 1

bib
Expand All @@ -25,14 +23,16 @@ Appendices
contributing
release

* :ref:`genindex`


.. toctree::
:caption: Memory Management Reference
:maxdepth: 2
:hidden:

mmref/index
mmref-index
mmref/faq
mmref-copyright
mmref/credit

* :ref:`genindex`