Removing the Edit on Github link when using Read The Docs & Sphinx with ReadTheDocs Theme

Viewed 2234

I'm trying to find out how to use the _template overrides option in Sphinx to override the default ReadTheDocs theme for hosting Sphinx documentation on http://readthedocs.org.

Specifically, I'm wanting to remove/hide the "Edit on Github" link shown in the upper right hand corner of this theme.

Any tips would be greatly appreciated! Thanks!

I've reviewed the documentation here: http://www.sphinx-doc.org/en/stable/templating.html, however, I'm stumped and really need some help.

Thank you!

3 Answers

My needs was very similar but not exactly the same. I wanted to both remove this link for generated pages ("search" and "genindex"), and change the link text because we use framagit as a project hosting.

Here is my version at the end:

{%- extends "sphinx_rtd_theme/breadcrumbs.html" %}

{% block breadcrumbs_aside %}
  <li class="wy-breadcrumbs-aside">
    {% if hasdoc(pagename) and pagename != "search" and pagename != "genindex" %}
      <a href="{{ meta['framagit_url'] }}" class="fa fa-bitbucket"> {{ _('Edit on FramaGit') }}</a>
    {% endif %}
  </li>
{% endblock %}

See it live here: https://framagit.org/simgrid/simgrid/tree/master/docs/source

Related