gpt4 book ai didi

python-sphinx - 基于 sphinx-bootstrap-theme 在 Python-Sphinx 文档上启用侧边栏

转载 作者:行者123 更新时间:2023-12-04 01:51:35 27 4
gpt4 key购买 nike

我正在使用漂亮的 sphinx-bootstrap-theme 0.3.4 并尝试将它应用到 Sphinx Python 文档生成器 1.2 版之上。

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

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

没有帮助。

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

最佳答案

刚刚想通了。这应该可以解决问题。

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

以此作为引用

Sphinx theming guide html_sidebars

我正在尝试创建自定义侧边栏,因为我不喜欢包含的选项。使用 bootstrap 演示 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']}

关于python-sphinx - 基于 sphinx-bootstrap-theme 在 Python-Sphinx 文档上启用侧边栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20939598/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com