Sphinx 2.1

版本 2.1.2 (发布于 2019 年 6 月 19 日)

修复的 Bug

  • #6497: 语法错误时自定义词法分析器高亮失败

  • #6478, #6488: 信息字段列表识别不正确

版本 2.1.1 (发布于 2019 年 6 月 10 日)

不兼容的变更

  • #6447: autodoc: 停止为未文档化的模块变量生成文档

修复的 Bug

  • #6442: LaTeX: note 类型的警告可能与紧接的前一节标题被分页符分开

  • #6448: autodoc: 在自动文档化 __slots__ = None 的类时崩溃

  • #6451: autodoc: 将“可选导入”的模块作为变量生成文档

  • #6452: autosummary: 生成属性文档时崩溃

  • #6455: napoleon: 属性的 docstring 未处理

  • #6436: napoleon: 如果变量名以下划线结尾,则出现“未知目标名称”错误

  • #6440: apidoc: 模块之间缺少空行

版本 2.1.0 (发布于 2019 年 6 月 2 日)

不兼容的更改

  • 忽略直接提供给 Builder.build_specific() API 且没有文件扩展名的文件名

  • #6230: 词汇表指令中术语的锚点在由非 ASCII 字符组成时会更改

  • #4550: html: 默认使用 CSS 居中表格

  • #6239: latex: xelatex 和 xeCJK 默认用于中文文档

  • Sphinx.add_lexer() 现在接受一个 Lexer 类而不是实例。直到 Sphinx 3.x,仍然支持词法分析器实例。

已弃用

  • sphinx.builders.latex.LaTeXBuilder.apply_transforms()

  • sphinx.builders._epub_base.EpubBuilder.esc()

  • sphinx.directives.Acks

  • sphinx.directives.Author

  • sphinx.directives.Centered

  • sphinx.directives.Class

  • sphinx.directives.CodeBlock

  • sphinx.directives.Figure

  • sphinx.directives.HList

  • sphinx.directives.Highlight

  • sphinx.directives.Include

  • sphinx.directives.Index

  • sphinx.directives.LiteralInclude

  • sphinx.directives.Meta

  • sphinx.directives.Only

  • sphinx.directives.SeeAlso

  • sphinx.directives.TabularColumns

  • sphinx.directives.TocTree

  • sphinx.directives.VersionChange

  • sphinx.domains.python.PyClassmember

  • sphinx.domains.python.PyModulelevel

  • sphinx.domains.std.StandardDomain._resolve_citation_xref()

  • sphinx.domains.std.StandardDomain.note_citations()

  • sphinx.domains.std.StandardDomain.note_citation_refs()

  • sphinx.domains.std.StandardDomain.note_labels()

  • sphinx.environment.NoUri

  • sphinx.ext.apidoc.format_directive()

  • sphinx.ext.apidoc.format_heading()

  • sphinx.ext.apidoc.makename()

  • sphinx.ext.autodoc.importer.MockFinder

  • sphinx.ext.autodoc.importer.MockLoader

  • sphinx.ext.autodoc.importer.mock()

  • sphinx.ext.autosummary.autolink_role()

  • sphinx.ext.imgmath.DOC_BODY

  • sphinx.ext.imgmath.DOC_BODY_PREVIEW

  • sphinx.ext.imgmath.DOC_HEAD

  • sphinx.transforms.CitationReferences

  • sphinx.transforms.SmartQuotesSkipper

  • sphinx.util.docfields.DocFieldTransformer.preprocess_fieldtypes()

  • sphinx.util.node.find_source_node()

  • sphinx.util.i18n.find_catalog()

  • sphinx.util.i18n.find_catalog_files()

  • sphinx.util.i18n.find_catalog_source_files()

有关更多详细信息,请参阅 已弃用 API 列表

新增功能

  • 添加辅助类 sphinx.transforms.post_transforms.SphinxPostTransform

  • 添加辅助方法

    • PythonDomain.note_module()

    • PythonDomain.note_object()

    • SphinxDirective.set_source_info()

  • #6180: 在 BuildDoc setup 命令中支持 --keep-going

  • math 指令现在支持 :class: 选项

  • todo: todo 指令现在支持 :name: 选项

  • 通过环境变量启用 SPHINXOPTSSPHINXBUILD Makefile 变量的覆盖(引用:#6232, #6303)

  • #6287: autodoc: 无法文档化作为模块函数导出的绑定实例方法

  • #6289: autodoc: autodoc_default_options 现在支持 imported-members 选项

  • #4777: autodoc: 支持协程

  • #744: autodoc: 支持抽象方法

  • #6325: autodoc: 支持 __slots__ 中的属性。对于字典风格的 __slots__,autodoc 将值视为属性的 docstring

  • #6361: autodoc: 添加 autodoc_typehints 以从签名中抑制类型提示

  • #1063: autodoc: automodule 指令现在处理未文档化的模块级别变量

  • #6212: autosummary: 添加 autosummary_imported_members 以在自动摘要中显示导入的成员

  • #6271: 如果构建到“.”中,make clean 会灾难性地损坏

  • #6363: 支持 make.bat 中的 %O% 环境变量

  • #4777: py 域: 添加 :async: 选项到 py:function 指令

  • py 域: 添加新选项到 py:method 指令

    • :abstractmethod

    • :async

    • :classmethod

    • :property

    • :staticmethod

  • rst 域: 添加 rst:directive:option 指令来描述指令的选项

  • #6306: html: 为可访问性目的向搜索表单添加标签

  • #4390: html: 签名的统一语义 CSS

  • #6358: production 节点的 rawsource 属性现在包含完整的生产规则

  • #6373: autosectionlabel: 允许抑制警告

  • coverage: 支持新的 coverage_ignore_pyobjects 选项

  • #6239: latex: 支持构建中文文档

修复的 Bug

  • #6230: 如果术语由非 ASCII 字符组成,词汇表指令会生成不合适的 node_id

  • #6213: ifconfig: 标题后的内容未显示

  • 词汇表指令中注释的术语被错误识别

  • #6299: rst 域: rst:directive 指令生成多余的空白

  • #6379: py 域: 模块索引 (py-modindex.html) 有重复的标题

  • #6331: man: 当 doctest 跟随标题时输出无效

  • #6351: 即使已引用,也会显示“超链接目标未被引用”消息

  • #6165: autodoc: Docutils 的 tab_width 设置已被忽略

  • #6347: autodoc: 在 Python 3.6 和 3.5 上使用普通元组时崩溃

  • #6311: autosummary: 自动摘要表被复杂的类型提示混淆

  • #6350: autosummary: 被具有某种默认值的参数混淆

  • 生成的 Makefiles 缺少最后的 EOL(引用:#6232)

  • #6375: extlinks: 无法在链接标题中转义尖括号

  • #6378: linkcheck: 发送常用 User-Agent

  • #6387: html 搜索: 使用 haiku 和 scrolls 主题搜索文档失败

  • #6408: html 搜索: 修复搜索结果的排名

  • #6406: SOURCE_DATE_EPOCH 返回错误的年份

  • #6402: image 指令因未知图像格式而崩溃

  • #6286: C++,允许在十六进制整数文字中使用 8 和 9。

  • #6305: 修复 quickstart 中解析器“path”参数的字符串

  • LaTeX: 警告中的图表产生错误(引用:#6364)