scverse_doc.release_notes#

A release notes directive.

Given a directory of version files matching FULL_VERSION_RE, render them grouped by minor version (where . is the directory they are in):

.. release-notes:: .

Each file is parsed by the parser for its suffix (see source_suffix), or else like the page. A file in another format than the page is parsed on its own, so its headings start at the top level (e.g. # in Markdown). With e.g. the files 1.2.0.md, 1.2.1.md, and 1.3.0.rst, this renders like the following:

.. _v1.3:

Version 1.3
===========

.. include:: 1.3.0.rst


.. _v1.2:

Version 1.2
===========

.. include:: 1.2.1.md
   :parser: myst_parser.sphinx_
.. include:: 1.2.0.md
   :parser: myst_parser.sphinx_
scverse_doc.release_notes.FULL_VERSION_RE = re.compile('^(\\d+)\\.(\\d+)\\.(\\d+)(?:.*)?$')#

Regex matching a full version number including patch part, maybe with more after.

Examples#

With the files 1.2.0.md, 1.2.1.md, and 1.3.0.md in release-notes-example/:

.. release-notes:: release-notes-example

Version 1.3#

1.3.0#

  • Added a feature.

Version 1.2#

1.2.1#

  • Fixed a bug.

1.2.0#

  • First release.