如何解决运行`make html`
我有一个项目,使用 Sphinx 与 sphinx_rtd_theme 结合生成文档。
基本上,当我运行 make html
命令来构建文档时,当我尝试打开 .html 时,它看起来就像没有 CSS 的裸 html。完全没有样式。
我在这里和 Github 上看到了一些发生这种情况的帖子,但这似乎与有人在 Github Pages 上托管并拥有 .nojekyll
文件有关。在我的场景中,我只是想在本地渲染它,但它仍然没有样式?
我还要注意,虽然在下面您会看到我正在尝试使用 sphinx_rtd_theme
,但我尝试仅使用 html_theme = "classic"
,但仍然无法呈现任何样式。
谁能帮忙解决这个问题?如果有帮助,我很乐意发布更多信息。
配置文件conf.py
如下所示。我已经包含了我认为相关的内容,并遗漏了中间用 ...
点标记的内容。
...
import codecs
import os
import re
import sys
import sphinx_rtd_theme
from recommonmark.parser import commonmarkParser
...
# -- Project information -----------------------------------------------------
...
# -- General configuration ---------------------------------------------------
# If your documentation needs a minimal Sphinx version,state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here,as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc","sphinx.ext.doctest","sphinx.ext.todo","sphinx.ext.coverage","sphinx.ext.imgmath","sphinx.ext.viewcode","sphinx.ext.githubpages","sphinx.ext.napoleon","sphinx_rtd_theme",]
# Add any paths that contain templates here,relative to this directory.
templates_path = ["_templates"]
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
source_parsers = {
".md": commonmarkParser,}
source_suffix = [".rst",".md"]
# The master toctree document.
master_doc = "index"
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
# List of patterns,relative to source directory,that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = []
# The name of the Pygments (Syntax highlighting) style to use.
pygments_style = "sphinx"
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
...
相关安装版本
sphinx-rtd-theme 0.5.1
sphinxcontrib-applehelp 1.0.2
sphinxcontrib-devhelp 1.0.2
sphinxcontrib-htmlhelp 1.0.3
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.3
sphinxcontrib-serializinghtml 1.1.4
Sphinx 3.4.3
编辑
当我运行make html
时,终端中的输出如下:
(proejct_name) [...]$ make html
sphinx-apidoc -f ../project_name -o source/
Creating file source/project_name.rst.
Creating file source/modules.rst.
Regenerated API docs in ./source
sphinx-build -b html source build/html
Running Sphinx v3.4.3
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 0 source files that are out of date
updating environment: [config changed ('source_parsers')] 8 added,0 changed,0 removed
reading sources... [100%] update_assumptions
looking for Now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] update_assumptions
generating indices... genindex py-modindex done
highlighting module code... [100%] project_name.utilities
writing additional pages... search done
copying images... [100%] _static/update_assumptions.png
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded.
The HTML pages are in build/html.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。