Skip to main content

提供简单的 Sphinx 标记来呈现变更日志显示。

项目描述

派皮 PyPI - Python 版本 PyPI - 下载

用于生成变更日志文件的Sphinx扩展。

这是SQLAlchemy项目和相关项目使用的一个实验性的、可能没有用的扩展 。

配置

conf.py中的示例配置如下所示:

extensions = [
            # changelog extension
            'changelog',

            # your other sphinx extensions
            # ...
        ]


# section names - optional
changelog_sections = ["general", "rendering", "tests"]

# section css classes - optional
changelog_caption_class = "caption"

# tags to sort on inside of sections - also optional
changelog_inner_tag_sort = ["feature", "bug"]

# whether sections should be hidden from tags list
changelog_hide_sections_from_tags = False

# whether tags should be hidden from entries
changelog_hide_tags_in_entry = False

# how to render changelog links - these are plain
# python string templates, ticket/pullreq/changeset number goes
# in "%s"
changelog_render_ticket = "http://bitbucket.org/myusername/myproject/issue/%s"
changelog_render_pullreq = "http://bitbucket.org/myusername/myproject/pullrequest/%s"
changelog_render_changeset = "http://bitbucket.org/myusername/myproject/changeset/%s"

用法

Changelog 引入了changelogchange指令:

====================
Changelog for 1.5.6
====================

.. changelog::
    :version: 1.5.6
    :released: Sun Oct 12 2008

    .. change::
        :tags: general
        :tickets: 27

      Improved the frobnozzle.

    .. change::
        :tags: rendering, tests
        :pullreq: 8
        :changeset: a9d7cc0b56c2

      Rendering tests now correctly render.

使用上述标记,上述更改将呈现到每个更改日志的文档部分,然后将每个更改组织成段落,包括标签的特殊标记、提到的票证、拉取请求、变更集。这些条目将根据changelog_sectionschangelog_inner_tag_sort配置的配置按标签进行分组和排序。

如果配置有这样的部分,也可以使用“复合标签”:

changelog_sections = ["orm declarative", "orm"]

然后包含orm声明性标签的更改条目将被分组到一个名为orm declarative的部分下,然后是orm部分,其中将放置仅包含orm的更改条目。

其他标记

: ticket:指令将使用changelog_render_ticket标记来呈现票链接:

:ticket:`456`

其他尚未记录的内容

  • : version:指令,指示变更日志条目也应在其他版本中列出

  • .. changelog_imports::指令 - 读取其他 changelog.rst 文件以查找适用于此变更日志文件的:version:指令,并将这些条目添加到此文件中的变更日志条目

  • :include_notes_from:符号 -将目录中的所有 .rst 文件导入到当前目录中,以便每个文件一个更改,使 git 合并成为可能

  • changelog release-notes命令在发布时收集上述每文件更改的 .rst 文件并将它们呈现到主 changelog.rst 文件中,在各个文件上运行“git rm”

  • changelog.rst -> markdown 转换器,用于需要用 markdown 编写更改日志部分的 Web gui

  • changelog.rst -> stream per changelog markdown API 函数,例如,可以将每个版本的 changelogs 流式传输到 github 版本 API

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

changelog-0.5.8.tar.gz (15.8 kB 查看哈希

已上传 source

内置分布

changelog-0.5.8-py3-none-any.whl (16.3 kB 查看哈希

已上传 py3