From 76ea9d44abb002fbf5173c052073dd8ffef8482d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Wed, 19 Aug 2020 16:53:15 +0200 Subject: [PATCH] Add support for warnings in the `featuretoggles` Sphinx extension --- CHANGELOG.rst | 5 +++++ code_annotations/__init__.py | 2 +- .../config_and_tools/sphinx/extensions/featuretoggles.py | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7d0dd47..06dabff 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,6 +11,11 @@ Change Log .. There should always be an "Unreleased" section for changes pending release. +[0.5.1] - 2020-08-25 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* Add support for warnings in the ``featuretoggles`` Sphinx extension + [0.5.0] - 2020-08-06 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/code_annotations/__init__.py b/code_annotations/__init__.py index e0747a9..cfbe56a 100644 --- a/code_annotations/__init__.py +++ b/code_annotations/__init__.py @@ -2,4 +2,4 @@ Extensible tools for parsing annotations in codebases. """ -__version__ = '0.5.0' +__version__ = '0.5.1' diff --git a/code_annotations/config_and_tools/sphinx/extensions/featuretoggles.py b/code_annotations/config_and_tools/sphinx/extensions/featuretoggles.py index 3ad152e..f5c7012 100644 --- a/code_annotations/config_and_tools/sphinx/extensions/featuretoggles.py +++ b/code_annotations/config_and_tools/sphinx/extensions/featuretoggles.py @@ -115,6 +115,10 @@ def iter_nodes(self): ), ) yield nodes.paragraph(text=toggle.get(".. toggle_description:", "")) + if toggle.get(".. toggle_warnings:") not in (None, "None", "n/a", "N/A"): + yield nodes.warning( + "", nodes.paragraph("", toggle[".. toggle_warnings:"]) + ) def quote_value(value):