Sphinx 2.0¶
发布 2.0.1 (发布于 2019 年 4 月 8 日)¶
修复的 Bug¶
LaTeX: 某些系统标签未翻译
RemovedInSphinx30Warning 标记为待处理
未发出弃用警告
sphinx.application.CONFIG_FILENAMEsphinx.builders.htmlhelpviewcode_import
#6208: C++,正确解析前缀为短 xref 的完整 xref
#6220, #6225: napoleon: 对于有引用的 raised section 抛出 AttributeError
#6245: 导入 SerializingHTMLBuilder 时出现循环导入错误
#6243: LaTeX: 忽略 latex_elements 的“releasename”设置
#6244: html: 搜索功能在第三方主题中损坏
#6263: html: HTML5Translator 因无效的字段节点崩溃
#6262: html 主题: bizstyle 主题中字段列表的样式已更改
发布 2.0.0 (发布于 2019 年 3 月 29 日)¶
依赖项¶
2.0.0b1
LaTeX 构建器现在依赖于 TeX Live 2015 或更高版本。
LaTeX 构建器(使用
'pdflatex'latex_engine)将通过文本字体处理文本(非数学标记)中的 Unicode 希腊字母,而不会将它们转义为数学标记。请参阅latex_elements的'fontenc'键的讨论;这种(可选的)希腊语支持会增加,例如在 Ubuntu xenial 上,texlive-lang-greek和(如果未修改默认字体设置)cm-super(-minimal)作为额外的 Sphinx LaTeX 要求。LaTeX 构建器,如果
latex_engine设置为'xelatex'或'lualatex',则(默认情况下)需要FreeFont字体,在 Ubuntu xenial 中,这些字体由软件包fonts-freefont-otf提供,例如在 Fedora 29 中通过软件包texlive-gnu-freefont提供。requests 2.5.0 或更高版本
six 包不再是依赖项
sphinxcontrib-websupport 包不再是依赖项
部分包已拆分为子包
sphinxcontrib.applehelp
sphinxcontrib.devhelp
sphinxcontrib.htmlhelp
sphinxcontrib.jsmath
sphinxcontrib.serializinghtml
sphinxcontrib.qthelp
不兼容的变更¶
2.0.0b1
放弃对 python 2.7 和 3.4 的支持
放弃对 Docutils 0.11 的支持
放弃在 1.7.x 中弃用的功能和 API
master_doc的默认设置已更改为'index',该设置长期以来一直作为 sphinx-quickstart 的默认设置。LaTeX: 将消息资源移动到
sphinxmessage.styLaTeX: 停止对某些标签使用
\captions<lang>宏LaTeX: 对于
'xelatex'和'lualatex',使用FreeFontOpenType 字体作为默认选择(refs: #5645)LaTeX:
'xelatex'和'lualatex'现在在代码块中使用\small(由于FreeMono字符宽度),就像'pdflatex'已经那样做(由于Courier字符宽度)。如果使用其他 OpenType 字体,您可能需要通过latex_elements'fvset'键进行调整(refs: #5768)LaTeX: 文本中的希腊字母不会被转义为数学模式标记,它们将使用文本字体而不是数学字体。为了使其生效(当然,只有在文档需要时),必须将
LGR字体编码添加到latex_elements的'fontenc'键中。LaTeX: 将
language设置为'en'会触发fncychap的Sonny选项,现在是Bjarne以匹配未指定语言的情况。(refs: #5772)#5770: doctest: 在高亮 doctest 块时遵循
highlight_language。因此,它们默认被高亮为 python3。HTMLTranslator、HTML5Translator和ManualPageTranslator的参数顺序已更改LaTeX: 以前在加载
'manual'文档类时完成的\l@section和\l@subsection的硬编码重定义现在在\sphinxtableofcontents时执行。这意味着自定义用户定义(来自 LaTeX 序言)现在将被覆盖。请使用\sphinxtableofcontentshook插入自定义用户定义。请参阅 宏。quickstart: 简化生成的
conf.py#4148: quickstart: 某些问题已删除。它们仍然可以通过命令行选项指定
websupport: 从 Sphinx 核心中解绑。请使用 sphinxcontrib-websupport
C++:基类的可见性现在始终按输入中的显示方式呈现。也就是说,
private现在会显示,而以前会被省略。LaTeX: 包含超大图像时,即使使用了宽度和/或高度选项,也会按比例缩放以不超过文本宽度和高度。(refs: #5956)
epub:
epub_title默认为project选项#4550: 所有没有
align选项的表格和图表都居中显示#4587: html: 默认输出 HTML5
2.0.0b2
texinfo: 图像文件被复制到
name-figure目录
已弃用¶
2.0.0b1
对评估 Python 2 语法的支持已弃用。这包括应转换为 Python 3 的配置文件。
EpubBuilder.build_mimetype()、EpubBuilder.build_container()、EpubBuilder.bulid_content()、EpubBuilder.build_toc()和EpubBuilder.build_epub()的参数Epub3Builder.build_navigation_doc()的参数配置变量
html_experimental_html5_writer
autodoc.Documenter.get_doc(),autodoc.DocstringSignatureMixin.get_doc(),autodoc.DocstringSignatureMixin._find_signature()和autodoc.ClassDocumenter.get_doc()的encoding参数已弃用。sphinx.ext.autodoc.importer._MockModule的importer参数sphinx.search.WordCollector. is_meta_keywords()的nodetype参数env.doc2path()的suffix参数已弃用。env.doc2path()的字符串样式base参数已弃用。允许省略重写的
IndexBuilder.feed()方法中的filename参数的回退已弃用。sphinx.addnodes.abbreviationsphinx.application.Sphinx._setting_up_extensionsphinx.builders.epub3.Epub3Builder.validate_config_value()sphinx.builders.html.SingleFileHTMLBuildersphinx.builders.htmlhelp.HTMLHelpBuilder.open_file()sphinx.cmd.quickstart.term_decode()sphinx.cmd.quickstart.TERM_ENCODINGsphinx.config.check_unicode()sphinx.config.string_classessphinx.domains.cpp.DefinitionError.descriptionsphinx.domains.cpp.NoOldIdError.descriptionsphinx.domains.cpp.UnsupportedMultiCharacterCharLiteral.decodedsphinx.ext.autodoc.importer._MockImportersphinx.ext.autosummary.Autosummary.warn()sphinx.ext.autosummary.Autosummary.genoptsphinx.ext.autosummary.Autosummary.warningssphinx.ext.autosummary.Autosummary.resultsphinx.ext.doctest.doctest_encode()sphinx.io.SphinxBaseFileInputsphinx.io.SphinxFileInput.supportedsphinx.io.SphinxRSTFileInputsphinx.registry.SphinxComponentRegistry.add_source_input()sphinx.roles.abbr_role()sphinx.roles.emph_literal_role()sphinx.roles.menusel_role()sphinx.roles.index_role()sphinx.roles.indexmarkup_role()sphinx.testing.util.remove_unicode_literal()sphinx.util.attrdictsphinx.util.force_decode()sphinx.util.get_matching_docs()sphinx.util.inspect.Parametersphinx.util.jsonimplsphinx.util.osutil.EEXISTsphinx.util.osutil.EINVALsphinx.util.osutil.ENOENTsphinx.util.osutil.EPIPEsphinx.util.osutil.walk()sphinx.util.PeekableIteratorsphinx.util.pycompat.NoneTypesphinx.util.pycompat.TextIOWrappersphinx.util.pycompat.UnicodeMixinsphinx.util.pycompat.htmlescapesphinx.util.pycompat.indentsphinx.util.pycompat.sys_encodingsphinx.util.pycompat.terminal_safe()sphinx.util.pycompat.usphinx.writers.latex.ExtBabelsphinx.writers.latex.LaTeXTranslator._make_visit_admonition()sphinx.writers.latex.LaTeXTranslator.babel_defmacro()sphinx.writers.latex.LaTeXTranslator.collect_footnotes()sphinx.writers.latex.LaTeXTranslator.generate_numfig_format()sphinx.writers.texinfo.TexinfoTranslator._make_visit_admonition()sphinx.writers.text.TextTranslator._make_depart_admonition()LaTeX 模板的模板变量
logo数字图_格式pageautorefnametranslatablestrings
有关更多详细信息,请参阅 已弃用 API 列表。
新增功能¶
2.0.0b1
#1618: 生成的 HTML 文档的搜索结果预览更加用户友好:Sphinx 现在将片段呈现为相应的 HTML,而不是显示为原始 reStructuredText 标记。这意味着 Sphinx 扩展 Sphinx: pretty search results 不再需要。请注意,您自定义或第三方 HTML 模板的搜索功能更改可能会覆盖此改进。
#4182: autodoc: 支持
suppress_warnings#5533: autodoc:
autodoc_default_options支持member-order#5394: autodoc: 在模拟对象中显示可读的类型注释名称
#5459: autodoc:
autodoc_default_options接受True作为值#1148: autodoc: 为装饰器添加
autodecorator指令#5635: autosummary: 添加
autosummary_mock_imports以在导入目标时模拟外部库#4018: htmlhelp: 添加
htmlhelp_file_suffix和htmlhelp_link_suffix#5559: text: 支持复杂表格(colspan 和 rowspan)
LaTeX: 支持在非西里尔文档中渲染(尚未在数学中)希腊语和西里尔语 Unicode 字母,即使
latex_engine设置为'pdflatex'(refs: #5645)#5660:
versionadded、versionchanged和deprecated指令现在除了通用versionmodified类之外,还生成具有其特定 CSS 类(分别为added、changed和deprecated)。#5841: apidoc: 为 sphinx-apidoc 添加 –extensions 选项
#4981: C++,添加了一个别名指令,用于插入声明列表,该列表引用现有声明(例如,用于制作概要)。
C++:添加
cpp:struct作为cpp:class的补充。#1341: HTML 搜索将包含三个或更多字符的搜索词的单词视为匹配。
#4611: epub: 显示重复目录条目的警告
#1851: 允许省略
code-block指令的参数。如果省略,它将遵循highlight或highlight_language#4587: html: 添加
html4_writer以使用旧的 HTML4 写入器#6016: HTML 搜索: 搜索摘要的占位符可防止搜索结果链接在搜索终止时改变其位置。这使得导航搜索结果更加容易。
#5196: linkcheck 也检查远程图像是否存在
#5924: githubpages: 当
html_baseurl设置时,为自定义域创建 CNAME 文件#4261: autosectionlabel: 通过新的配置值限制带标签的章节;
autosectionlabel_maxdepth
修复的 Bug¶
2.0.0b1
#1682: LaTeX: 写入器不应翻译希腊语 Unicode,而应使用 textgreek 包
#5247: LaTeX: 在俄罗斯语言和
'xelatex'或'lualatex'作为latex_engine的默认字体配置下,PDF 无法构建 (refs: #5251)#5248: LaTeX: 节标题中的希腊 Unicode 字母从 PDF 书签中消失
#5249: LaTeX: 数学指令中的 Unicode 希腊字母导致 PDF 构建中断(修复需要额外设置,请参阅
latex_elements'textgreek'键和/或latex_engine设置)#5772: LaTeX: 如果将 Bjarne 风格的 fncychap 作为语言选项传递,它是否也应该用于英语?
#5179: LaTeX: (仅限 lualatex) 通过
\textgreater{}转义>是不够的,因为\textgreater{}\textgreater{}会应用 TeX 连字LaTeX: 如果省略
latex_documents,项目名称不被转义LaTeX: 如果省略
latex_documents,不显示作者HTML: 对于一个词汇表有多个描述的术语,会生成无效的 HTML5 文件(refs: #4611)
QtHelp: .qhp 文件中使用与操作系统相关的路径分隔符
HTML 搜索: 当使用多个搜索词且其中一个词少于三个字符时,搜索总是返回空结果
2.0.0b2
#6096: html: 锚点链接未添加到图中
#3620: html: 延迟加载 searchindex.js,而不是通过 ajax 加载
#6113: html: 表格单元格和列表项有大边距
#5508:
highlight指令的linenothreshold选项被忽略texinfo:
make install-info导致语法错误texinfo:
make install-info在 macOS 上失败#3079: texinfo: 在
make install-info时,图像文件未被复制#5391: 标题中的交叉引用呈现为文字
#5946: C++,修复 LaTeX (和 singlehtml) 中的
cpp:alias问题#6147:
citation_reference节点的 classes 属性丢失当带有 classes 属性的自定义
citation_reference节点引用缺失引用时,会引发 AssertionError(refs: #6147)#2155: 支持
code指令C++,修复带括号初始化器的解析。
#6172: 对旧式索引节点抛出 AttributeError
#4872: inheritance_diagram: 正确描述 docs 中
parts选项的行为,允许负值。#6178: i18n: 隐藏 TOC 的翻译中缺少标题
2.0.0 最终版
#6196: py 领域: 生成了意外前缀
测试¶
2.0.0b1
停止使用
SPHINX_TEST_TEMPDIR环境变量
2.0.0b2
添加了一个辅助函数:
sphinx.testing.restructuredtext.parse()