如何编辑Sphinx Alabaster主题下的补充工具栏

nev*_*int 6 python restructuredtext python-sphinx

我有以下index.rst文件.

Know the cell population of your data
=====================================
Some content

.. toctree::
   :maxdepth: 2

Installation
~~~~~~~~~~~~
.. toctree::
   :maxdepth: 2

   installation

Scripts
~~~~~~~
.. toctree::
   :maxdepth: 2

   scripts

API documentation
~~~~~~~~~~~~~~~~~
.. toctree::
   :maxdepth: 2

   apidoc

Roadmap
~~~~~~~
.. toctree::
   :maxdepth: 2

   roadmap

Indices and Tables
==================
* :ref: `genindex`
Run Code Online (Sandbox Code Playgroud)

现在侧边栏看起来像这样:

在此输入图像描述

如该图像中所述.我想做几件事.

  1. 在侧栏中删除标题,但将其保留在主页面中.
  2. 添加新的URL链接,但不在主页中显示,如"指数和表"

我怎样才能做到这一点?

nev*_*int 8

我终于通过以下方式修复了它

在Sphinx的_template目录中创建一个名为的文件foo.html.

内容可能如下所示:

<hr />
<p>
<h2 class='logo'>
<a href="https://foo.bar.com/">Web Version</a>
</h2>
</p>
Run Code Online (Sandbox Code Playgroud)

最后在conf.py中添加:

html_sidebars = {
        '**': [
                 'localtoc.html',
                 'relations.html',
                 'searchbox.html',
                 # located at _templates/
                 'foo.html',
            ]

        }
Run Code Online (Sandbox Code Playgroud)

最后它看起来像这样:

在此输入图像描述