2015-10-09 33 views
2

我有以下index.rst文件。如何编辑Sphinx雪花石膏主题下的Sidebar

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` 

现在侧边栏看起来是这样的:

enter image description here

由于该图像中所描述。我想要做几件事情。

  1. 去掉标题只在侧边栏但保持它的主页。
  2. 添加新的URL链接,但没有表现出像“指标和表”在主页它

我怎么能这样做?

+0

[文档](http://alabaster.readthedocs .io/en/latest/customization.html)描述了如何克服这些问题。 – Carel

回答

4

我终于固定它通过以下方式

在狮身人面像的_template目录创建一个文件 ,称为foo.html

的内容可能是这个样子:

<hr /> 
<p> 
<h2 class='logo'> 
<a href="https://foo.bar.com/">Web Version</a> 
</h2> 
</p> 

终于在conf.py补充一点:

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

     } 

在最后它看起来像这样:

enter image description here

1

我可以为第一个问题提出一些建议。我绝不是CSS方面的专家,所以我的解决方案可能不是更优雅的方案,但它的工作原理!把你的“源/ _static/custom.css”文件:

.sphinxsidebar a.reference.internal[href='#'] { 
    display: none; 
} 

也许一个CSS专家应该给出一个更好的选择......