How do Sphinx configurations setup "breadcrumbs" in the header? I have a Sphinx project and all I see is the project name; if I jump down into subpages I get lost and I don't see the path to the current page.
Some examples in the wild:
https://docs.python.org/2.7/library/argparse.html
See top line: Documentation >> The Python Standard Library >> 15. Generic Operating System Services
http://docs.scipy.org/doc/numpy/reference/arrays.ndarray.html
See the rounded rectangles at the top
Source code for scipy appears to be here:
- https://raw.githubusercontent.com/numpy/numpy/v1.11.1/doc/source/reference/index.rst
- https://raw.githubusercontent.com/numpy/numpy/v1.11.1/doc/source/reference/arrays.rst
- https://raw.githubusercontent.com/numpy/numpy/v1.11.1/doc/source/reference/arrays.ndarray.rst
It looks like the Sphinx "basic" theme has this functionality built-in as the "relbar":
From https://github.com/sphinx-doc/sphinx/blob/master/sphinx/themes/basic/layout.html:
{%- macro relbar() %}
<div class="related" role="navigation" aria-label="related navigation">
<h3>{{ _('Navigation') }}</h3>
<ul>
{%- for rellink in rellinks %}
<li class="right" {% if loop.first %}style="margin-right: 10px"{% endif %}>
<a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}"
{{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
{%- if not loop.first %}{{ reldelim2 }}{% endif %}</li>
{%- endfor %}
{%- block rootrellink %}
<li class="nav-item nav-item-0"><a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>{{ reldelim1 }}</li>
{%- endblock %}
{%- for parent in parents %}
<li class="nav-item nav-item-{{ loop.index }}"><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>{{ reldelim1 }}</li>
{%- endfor %}
{%- block relbaritems %} {% endblock %}
</ul>
</div>
{%- endmacro %}
see also http://www.sphinx-doc.org/en/stable/templating.html
But I can't figure out how to enable.
OK, I am really confused here. I got something to appear but not the way I wanted.
I have my index.rst for my project "MyDoc":
Top Level Page Title Is Here
============================
content goes here
.. toctree::
:maxdepth: 2
introduction
(other files)
and then I have introduction.rst
Introduction
============
content goes here
.. toctree::
:maxdepth: 2
test1
and test1.rst
Test1
============
blah blah
- For index.html it shows MyDoc in the relbar.
- For introduction.html it shows MyDoc in the relbar. (I would have expected MyDoc >> Introduction)
- For test1.html it shows MyDoc >> Introduction in the relbar. (I would have expected MyDoc >> Introduction >> Test1)
I guess what I am confused about is why it works this way.