diff -Nru python-changelog-0.5.4/changelog/docutils.py python-changelog-0.5.5/changelog/docutils.py --- python-changelog-0.5.4/changelog/docutils.py 2020-07-12 12:44:17.000000000 +0000 +++ python-changelog-0.5.5/changelog/docutils.py 2020-09-30 13:10:35.000000000 +0000 @@ -74,6 +74,9 @@ # 1. pull in global configuration from conf.py self.sections = self.env.changelog_sections self.inner_tag_sort = self.env.changelog_inner_tag_sort + [""] + self.hide_sections_from_tags = bool( + self.env.changelog_hide_sections_from_tags + ) # 2. examine top level directives inside the .. changelog:: # directive. version, release date @@ -205,7 +208,7 @@ return [] - body_paragraph = nodes.paragraph("", "") + body_paragraph = nodes.paragraph("", "", classes=["caption"]) self.state.nested_parse(content["text"], 0, body_paragraph) raw_text = _text_rawsource_from_node(body_paragraph) diff -Nru python-changelog-0.5.4/changelog/environment.py python-changelog-0.5.5/changelog/environment.py --- python-changelog-0.5.4/changelog/environment.py 2019-11-01 01:46:03.000000000 +0000 +++ python-changelog-0.5.5/changelog/environment.py 2020-09-30 13:10:42.000000000 +0000 @@ -39,6 +39,10 @@ raise NotImplementedError() @property + def changelog_hide_sections_from_tags(self): + raise NotImplementedError() + + @property def changelog_render_ticket(self): raise NotImplementedError() @@ -78,7 +82,11 @@ @property def changelog_inner_tag_sort(self): - return self.config.get("inner_tag_sort", []) + return self.config.get("changelog_inner_tag_sort", []) + + @property + def changelog_hide_sections_from_tags(self): + return self.config.get("changelog_hide_sections_from_tags", []) @property def changelog_render_ticket(self): diff -Nru python-changelog-0.5.4/changelog/generate_rst.py python-changelog-0.5.5/changelog/generate_rst.py --- python-changelog-0.5.4/changelog/generate_rst.py 2019-11-01 01:46:03.000000000 +0000 +++ python-changelog-0.5.5/changelog/generate_rst.py 2020-09-30 13:10:09.000000000 +0000 @@ -146,7 +146,27 @@ rec["version_to_hash"][changelog_directive.version], ) targetnode = nodes.target("", "", ids=[targetid]) - para.insert(0, targetnode) + + sections = section.split(" ") if section else [] + section_tags = [tag for tag in sections if tag in rec["tags"]] + category_tags = [cat] if cat in rec["tags"] else [] + other_tags = list( + sorted(rec["tags"].difference(section_tags + category_tags)) + ) + + all_items = [] + + if not changelog_directive.hide_sections_from_tags: + all_items.extend(section_tags) + all_items.extend(category_tags) + all_items.extend(other_tags) + + all_items = all_items or ["no_tags"] + + tag_node = nodes.strong("", " ".join("[%s]" % t for t in all_items)) + targetnode.insert(0, nodes.Text(" ", " ")) + targetnode.insert(0, tag_node) + permalink = nodes.reference( "", "", @@ -154,7 +174,9 @@ refid=targetid, classes=["changelog-reference", "headerlink"], ) - para.append(permalink) + targetnode.append(permalink) + + para.insert(0, targetnode) if len(rec["versions"]) > 1: @@ -217,18 +239,6 @@ node = nodes.Text(prefix % refname, prefix % refname) insert_ticket.append(node) - if rec["tags"]: - tag_node = nodes.strong( - "", - " ".join( - "[%s]" % t - for t in [t1 for t1 in [section, cat] if t1 in rec["tags"]] - + list(sorted(rec["tags"].difference([section, cat]))) - ), - ) - para.children[0].insert(0, nodes.Text(" ", " ")) - para.children[0].insert(0, tag_node) - append_sec.append( nodes.list_item("", nodes.target("", "", ids=[rec["id"]]), para) ) diff -Nru python-changelog-0.5.4/changelog/__init__.py python-changelog-0.5.5/changelog/__init__.py --- python-changelog-0.5.4/changelog/__init__.py 2020-09-23 18:40:06.000000000 +0000 +++ python-changelog-0.5.5/changelog/__init__.py 2020-11-24 17:30:21.000000000 +0000 @@ -1,3 +1,3 @@ -__version__ = "0.5.4" +__version__ = "0.5.5" from .sphinxext import setup # noqa diff -Nru python-changelog-0.5.4/changelog/sphinxext.py python-changelog-0.5.5/changelog/sphinxext.py --- python-changelog-0.5.4/changelog/sphinxext.py 2020-04-11 16:40:17.000000000 +0000 +++ python-changelog-0.5.5/changelog/sphinxext.py 2020-09-30 13:08:43.000000000 +0000 @@ -45,6 +45,10 @@ return self.sphinx_env.config.changelog_inner_tag_sort @property + def changelog_hide_sections_from_tags(self): + return self.sphinx_env.config.changelog_hide_sections_from_tags + + @property def changelog_render_ticket(self): return self.sphinx_env.config.changelog_render_ticket @@ -99,6 +103,7 @@ app.add_directive("changelog_imports", ChangeLogImportDirective) app.add_config_value("changelog_sections", [], "env") app.add_config_value("changelog_inner_tag_sort", [], "env") + app.add_config_value("changelog_hide_sections_from_tags", False, "env") app.add_config_value("changelog_render_ticket", None, "env") app.add_config_value("changelog_render_pullreq", None, "env") app.add_config_value("changelog_render_changeset", None, "env") diff -Nru python-changelog-0.5.4/changelog.egg-info/PKG-INFO python-changelog-0.5.5/changelog.egg-info/PKG-INFO --- python-changelog-0.5.4/changelog.egg-info/PKG-INFO 2020-09-23 18:44:07.000000000 +0000 +++ python-changelog-0.5.5/changelog.egg-info/PKG-INFO 2020-11-24 17:30:55.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: changelog -Version: 0.5.4 +Version: 0.5.5 Summary: Provides simple Sphinx markup to render changelog displays. Home-page: https://github.com/sqlalchemyorg/changelog Author: Mike Bayer @@ -49,6 +49,9 @@ # 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 + # how to render changelog links - these are plain # python string templates, ticket/pullreq/changeset number goes # in "%s" diff -Nru python-changelog-0.5.4/debian/changelog python-changelog-0.5.5/debian/changelog --- python-changelog-0.5.4/debian/changelog 2020-10-06 12:28:06.000000000 +0000 +++ python-changelog-0.5.5/debian/changelog 2020-11-30 11:17:07.000000000 +0000 @@ -1,3 +1,10 @@ +python-changelog (0.5.5-1) unstable; urgency=medium + + * New upstream release. + * Bump Standards-Version to 4.5.1, no changes needed. + + -- Dmitry Shachnev Mon, 30 Nov 2020 14:17:07 +0300 + python-changelog (0.5.4-1) unstable; urgency=medium [ Ondřej Nový ] diff -Nru python-changelog-0.5.4/debian/control python-changelog-0.5.5/debian/control --- python-changelog-0.5.4/debian/control 2020-10-06 12:28:06.000000000 +0000 +++ python-changelog-0.5.5/debian/control 2020-11-30 11:17:07.000000000 +0000 @@ -9,7 +9,7 @@ python3-setuptools, python3-sphinx Rules-Requires-Root: no -Standards-Version: 4.5.0 +Standards-Version: 4.5.1 Homepage: https://github.com/sqlalchemyorg/changelog Vcs-Git: https://salsa.debian.org/python-team/packages/python-changelog.git Vcs-Browser: https://salsa.debian.org/python-team/packages/python-changelog diff -Nru python-changelog-0.5.4/PKG-INFO python-changelog-0.5.5/PKG-INFO --- python-changelog-0.5.4/PKG-INFO 2020-09-23 18:44:07.334624800 +0000 +++ python-changelog-0.5.5/PKG-INFO 2020-11-24 17:30:55.825934200 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: changelog -Version: 0.5.4 +Version: 0.5.5 Summary: Provides simple Sphinx markup to render changelog displays. Home-page: https://github.com/sqlalchemyorg/changelog Author: Mike Bayer @@ -49,6 +49,9 @@ # 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 + # how to render changelog links - these are plain # python string templates, ticket/pullreq/changeset number goes # in "%s" diff -Nru python-changelog-0.5.4/README.rst python-changelog-0.5.5/README.rst --- python-changelog-0.5.4/README.rst 2020-09-23 18:43:46.000000000 +0000 +++ python-changelog-0.5.5/README.rst 2020-09-30 13:08:43.000000000 +0000 @@ -41,6 +41,9 @@ # 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 + # how to render changelog links - these are plain # python string templates, ticket/pullreq/changeset number goes # in "%s"