首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >readthedocs构建无法使用shields.io svg徽章生成狮身人面像文档。

readthedocs构建无法使用shields.io svg徽章生成狮身人面像文档。
EN

Stack Overflow用户
提问于 2022-06-03 07:24:37
回答 1查看 149关注 0票数 0

我最新的狮身人面像文档在试图用readthedocs构建它时失败了。这与我试图加入一些来自https://shields.io/的徽章有很大的关系。这些徽章是.svg图形文件。

我可能需要对我的conf.py文件做一些调整吗?

在我的本地机器上,我能够生成Sphinx文档,并且所有HTML文件看起来都不错。

以下是我的conf.py文件的摘录:

代码语言:javascript
复制
# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    "nbsphinx",
    "numpydoc",
    "sphinx.ext.autodoc",
    "sphinx_copybutton",
    "sphinx.ext.napoleon",
]

napoleon_google_docstring = False
napoleon_numpy_docstring = True
numpy_validation_checks = {all}

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# 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 = []


# -- 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"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = []

以下是文本输出:https://readthedocs.org/api/v2/build/17082650.txt

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-06-04 07:39:03

虽然您可能已经禁用了RTD UI中的epub和PDF构建,但在高级设置>默认设置下,您必须在RTD UI中注意:

可以使用配置文件配置这些设置。这是设置项目的推荐方法。当使用配置文件时,此处列出的设置将被忽略。

因此,您必须使用同时启用pdf和epub生成的配置文件。瞧,瞧:

https://github.com/andreas-vester/df2img/blame/3ba6e046c8d30ab3896b23835513740bd5aa97fa/.readthedocs.yaml#L12-L14

代码语言:javascript
复制
formats:
  - pdf
  - epub
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72486078

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档