首页 > 解决方案 > SPHINX 引导主题 | 无法正常工作

问题描述

我正在将 Sphinx 文档read_the_docssphinx_bootstrap_theme. 我有问题,而且很多。

问题 1:Bootstrap 主题没有加载 javascript 部分 虽然主题的大部分 CSS 都在工作,但依赖于 JQuery 的 Javascript 部分没有被加载。

我尝试了什么:

Insert the cdn for JQuery in my layout.html. Didn't work.

问题 2:导航栏无法正常工作

我得到了导航栏的大部分内容。链接是标题,搜索框。但是CSS完全搞砸了。

The title is on the right, the navigation menu is is a list view on the left.

问题 3:侧边栏目录不起作用

我希望我globaltoc.html出现在左侧边栏中。目前除了TABLE OF CONTENTS我在那里硬编码的标题之外,它没有显示任何内容。

到目前为止我做了什么:

Created a `globaltoc.html` and inserted the following:
{#
    basic/globaltoc.html
    ~~~~~~~~~~~~~~~~~~~~

    Sphinx sidebar template: global table of contents.

    :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
    :license: BSD, see LICENSE for details.
#}
<h3><a href="{{ pathto(master_doc) }}">{{ _('Table of Contents') }}</a></h3>
{{ toctree() }}

我真的很想得到一些帮助,包括以下内容。我真的对这个框架感到困惑。即使你指点我某个地方寻求帮助,那也很棒。

因此,总结问题并帮助您回答。

  1. 如何包含 JS,以及 JQuery 对 sphinx 项目的依赖?
  2. 如何确保所有引导 CSS 类按预期工作?
  3. 如何正确显示每个页面中的目录?

标签: javascriptpythonjquerycsspython-sphinx

解决方案


推荐阅读