基于Sphinx引导程序主题在Python Sphinx文档上启用侧边栏



我正在使用漂亮的sphinx引导主题0.3.4,并试图将其应用于sphinx Python文档生成器1.2版之上。

当我通过make html构建文档时,我没有得到任何侧边栏,尽管在本例中显示这是可能的。两者都没有,我在构建配置文件(conf.py)中找不到任何启用侧边栏的选项。执行以下操作:

html_sidebars = {'sidebar': ['localtoc.html', 'sourcelink.html', 'searchbox.html']}

没有帮助。

感谢您提供任何关于如何启用Sphinx主题侧边栏的提示。

刚刚想好了。这应该奏效。

html_sidebars = {'**': ['localtoc.html', 'sourcelink.html', 'searchbox.html']}

使用此作为参考

狮身人面像主题化指南html_sidebars

我正在尝试创建一个自定义侧边栏,因为我不喜欢包含的选项。使用引导程序演示index.html,我为自定义侧边栏创建了以下内容。只需将其命名为类似my_custom_sidebar.html的名称,并将其放入/source/_templates 中即可

<ul class="globaltoc"
>{{ toctree(maxdepth=theme_globaltoc_depth|toint, collapse=False,includehidden=theme_globaltoc_includehidden|tobool) }}</ul>

然后编辑html_sidebars

html_sidebars = {'**': ['my_custom_sidebar.html', 'searchbox.html']}

最新更新