Sphinx 3.0

发布 3.0.4(发布于 2020 年 5 月 27 日)

修复的 Bug

  • #7567: autodoc: 参数化类型在泛型类型中显示两次

  • #7637: autodoc: 系统定义的 TypeVars 在 Python 3.9 中显示

  • #7696: html: 出于安全原因,jQuery 版本从 3.4.1 更新到 3.5.1

  • #7611: 当 OpenSSL FIPS 启用时 md5 失败

  • #7626: 发布包不包含 CODE_OF_CONDUCT

发布 3.0.3(发布于 2020 年 4 月 26 日)

新增功能

  • C,解析带有 static、qualifiers 和 VLA 规范的数组声明符。

修复的 Bug

  • #7516: autodoc: 如果目标对象在访问其属性时引发错误,则崩溃

发布 3.0.2(发布于 2020 年 4 月 19 日)

新增功能

修复的 Bug

  • #7461: py domain: 类型注解中的空元组导致 IndexError

  • #7510: py domain: 仅限关键字的参数被记录为默认值为 None

  • #7418: std domain: term 角色无法进行大小写不敏感匹配

  • #7461: autodoc: 类型注解中的空元组显示不正确

  • #7479: autodoc: 自 3.0.0 版本以来,Sphinx 构建在模拟时变慢

  • C++,修复东部 const 声明中的间距问题。

  • #7414: LaTeX: Xindy 语言选项不正确

  • Sphinx 在 python3.5.1 上因 ImportError 崩溃

发布 3.0.1(发布于 2020 年 4 月 11 日)

不兼容的变更

  • #7418: std domain: term 角色变得大小写敏感

修复的 Bug

  • #7428: py domain: 对 None 类的引用发出 nitpicky 警告

  • #7445: py domain: 函数签名中的返回注解 None 在使用 intersphinx 时未转换为超链接

  • #7418: std domain: 词汇表术语的重复警告不区分大小写

  • #7438: C++,修复并行构建中重载函数的合并。

  • #7422: autodoc: 使用 autodoc_mock_imports 时引发 ValueError

  • #7435: autodoc: autodoc_typehints='description' 不抑制类/方法的签名中的类型提示

  • #7451: autodoc: 当对象返回非字符串对象作为 __doc__ 成员时,引发 AttributeError

  • #7423: 将非字符串对象传递给 logger 时崩溃

  • #7479: html theme: HTML 5 doctype 不包含 xmlns 属性

  • #7426: html theme: HTML 模板中的某些链接进行转义

发布 3.0.0(发布于 2020 年 4 月 6 日)

依赖项

3.0.0b1

  • LaTeX: 在日语文档中,不再依赖 extractbb 进行图像包含,因为自 TeXLive2015 以来 dvipdfmx 不再需要 .xbb 文件(参考:#6189)

  • babel-2.0 或更高版本可用(未固定)

不兼容的更改

3.0.0b1

  • 删除 1.8.x 中已废弃的功能和 API

  • #247: autosummary: 默认情况下,存根文件会自动覆盖。请参阅 autosummary_generate_overwrite 以更改行为

  • #5923: autodoc: 默认情况下,当给定 :inherited-members::special-members: 时,不记录 object 类的成员。

  • #6830: py domain: info-field-list 中的 meta 字段变为保留字段。它们现在不显示在输出文档中

  • #6417: py domain: desc_parameterlist 的 doctree 已更改。参数名称、注解和默认值都用内联节点包装

  • sphinx.events.EventManager.listeners 的结构已更改

  • 由于 productionlist 的作用域更改,某些 token 的使用必须修改以包含以前被忽略的作用域。

  • #6903: Python、reST 和标准域的内部数据结构已更改。node_id 已添加到对象和模块的索引中。现在它们包含 docname 和 node_id 的对,用于交叉引用。

  • #7276: C++ domain: 删除了意外行为,例如 say_hello_ 链接到 .. cpp:function:: say_hello()

  • #7210: js domain: 删除了意外行为,例如 parseInt_ 链接到 .. js:function:: parseInt

  • #7229: rst domain: 删除了意外行为,例如 numref_ 链接到 .. rst:role:: numref

  • #6903: py domain: 删除了意外行为,例如 say_hello_ 链接到 .. py:function:: say_hello()

  • #7246: py domain: 删除了异常、函数和方法的特殊交叉引用帮助器

  • C 域已重写,并增加了额外的指令和角色。现有的指令和角色现在更加严格,从而产生了新的警告。

  • desc_signature_line 节点中的属性 sphinx_cpp_tagname 已重命名为 sphinx_line_type

  • #6462: 默认情况下,域指令中的双反斜杠不再替换为单反斜杠。用户可以使用新的配置值 strip_signature_backslash 重新启用它。

3.0.0 最终版

  • #7222: sphinx.util.inspect.unwrap() 重命名为 unwrap_all()

已弃用

3.0.0b1

  • desc_signature['first']

  • sphinx.directives.DescDirective

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

  • sphinx.domains.python.PyDecoratorMixin

  • sphinx.ext.autodoc.get_documenters()

  • sphinx.ext.autosummary.process_autosummary_toc()

  • sphinx.parsers.Parser.app

  • sphinx.testing.path.Path.text()

  • sphinx.testing.path.Path.bytes()

  • sphinx.util.inspect.getargspec()

  • sphinx.writers.latex.LaTeXWriter.format_docclass()

新增功能

3.0.0b1

  • #247: autosummary: 添加 autosummary_generate_overwrite 以覆盖旧的存根文件

  • #5923: autodoc: :inherited-members: 选项采用祖先类名,用于不文档化该类及以上类的继承成员

  • #6830: autodoc: 如果 docstring 在 info-field-list 中包含 :meta private:,则认为该成员是私有的

  • #7165: autodoc: 支持 Annotated 类型(PEP-593)

  • #2815: autodoc: 支持 singledispatch 函数和方法

  • #7079: autodoc: autodoc_typehints 接受 "description" 配置。它将类型提示显示为对象描述

  • #7314: apidoc: 通过包文档传播 --maxdepth 选项

  • #6558: glossary: 对重复的词汇表条目发出警告

  • #3106: domain: 自动为索引页注册超链接目标

  • #6558: std domain: 对重复的泛型对象发出警告

  • #6830: py domain: 添加新事件:object-description-transform

  • #6895: py domain: 不对内置类型发出 nitpicky 警告

  • py domain: 支持函数签名中的 lambda 函数

  • #6417: py domain: 允许为函数和方法的参数创建样式

  • #7238, #7239: py domain: 如果 Python 对象条目已以相同名称添加,则在描述时发出警告

  • #7341: py domain: 签名中的类型注解转换为交叉引用

  • 支持事件处理程序的优先级。有关详细信息,请参阅 Sphinx.connect()

  • #3077: 按照文档中的指示,为 productionlist 实现作用域。

  • #1027: 支持 productionlist 中的反斜杠续行。

  • #7108: config: 允许通过 ConfigError 从 conf.py 显示错误消息

  • #7032: html: 对于具有 no-scaled-link 类的图像,html_scaled_image_link 将被禁用

  • #7144: 为每个 desc 节点添加表示其域的 CSS 类

  • #7211: latex: 使用 XeLaTeX 时,中文文档使用 babel

  • #6672: LaTeX: 支持 LaTeX 主题(实验性)

  • #7005: LaTeX: 为 kbd 角色添加 LaTeX 样式宏

  • #7220: genindex: 首先显示“主要”索引条目

  • #7103: linkcheck: 将所有链接写入 output.json

  • #7025: html search: 可以通过文件范围的元数据 :nosearch: 禁用单个文档的全文搜索

  • #7293: html search: 允许通过 SearchLanguage.js_splitter_code 覆盖 JavaScript 分割器

  • #7142: html theme: 添加主题选项:pygments_dark_style 以在深色模式下切换代码块的样式

  • C 域已重写,例如增加了

    • 尊重当前作用域的交叉引用。

    • 可以文档化匿名实体。

    • 针对每种实体类型提供更具体的指令和角色,例如,处理枚举器的作用域。

    • 新角色 c:expr 用于在文本中渲染表达式和类型。

  • 添加了 SphinxDirective.get_source_info()SphinxRole.get_source_info()

  • #7324: sphinx-build: 如果找到具有不同文件扩展名的多个同文档文件,则发出警告

3.0.0 最终版

  • 添加了 ObjectDescription.transform_content()

修复的 Bug

3.0.0b1

  • C++,修复在某些涉及函数重载的情况下交叉引用查找。

  • #5078: C++,修复当指令包含多个声明时的交叉引用查找。

  • C++,抑制签名中自动生成的交叉引用中直接依赖类型名称的警告。

  • #5637: autodoc: show-inheritance 上嵌套类名处理不正确

  • #7267: autodoc: 无效指令选项的错误消息位置不正确

  • #7329: autodoc: 即使设置了 autoclass_content='class',info-field-list 也会从类型提示错误地生成到类描述中

  • #7331: autodoc: cython 函数未被识别为函数

  • #5637: inheritance_diagram: 嵌套类名处理不正确

  • #7139: code-block:: guess 不起作用

  • #7325: html: source_suffix 包含点会导致错误的源链接

  • #7357: html: 调整 SVG 图像大小失败并引发 ValueError

  • #7278: html search: 修复搜索结果中使用 html_file_suffix 而非 html_link_suffix 的问题

  • #7297: html theme: bizstyle 不支持 sidebarwidth

  • #3842: singlehtml: 当主文档不在源根目录时,图像路径损坏

  • #7179: std domain: 修复引用 GenericObject 时抑制空白的问题

  • #7289: console: 使用亮色而不是粗体

  • #1539: C,解析数组类型。

  • #2377: C,即使在复杂类型中也解析函数指针。

  • #7345: sphinx-build: 如果输出目录作为文件存在,Sphinx 会崩溃

  • #7290: sphinx-build: 在处理异常时忽略 bdb.BdbQuit

  • #6240: napoleon: Attributes 和 Methods 部分忽略 :noindex: 选项

3.0.0 最终版

  • #7364: autosummary: 当 autosummary_generateFalse 时崩溃

  • #7370: autosummary: 给定未知模块时引发 UnboundLocalError

  • #7367: C++,现在支持备用运算符拼写。

  • C,现在支持备用运算符拼写。

  • #7368: C++,表达式中的逗号运算符,模板参数列表中的包扩展,以及某些情况下更全面的错误消息。

  • C,C++,修复与匿名符号相关的崩溃和错误的重复警告。

  • #6477: 交叉引用链接中的第一个“!”不再可能被转义

  • #7219: py domain: py:function 指令生成的索引条目与使用“builtin”类型的 index 指令生成的索引条目不同

  • #7301: node_id 不允许使用大写字符

  • #7301: epub: 生成重复的 node_ids

  • #6564: html: HTML 构建器忽略表格宽度

  • #7401: env-get-outdated 处理程序传递了不正确的参数

  • #7355: autodoc: cython 函数的签名未正确识别

  • #7222: autodoc: __wrapped__ 函数未正确文档化

  • #7409: intersphinx: 当扩展在 config-inited 事件上设置 intersphinx_mapping 时引发 ValueError

  • #7343: 自 2.4.0 版本以来,Sphinx 构建在调试模式下变慢