From 901ad06a313ff30361310a5a1ed765b13b1ee154 Mon Sep 17 00:00:00 2001 From: Kevin Putnam Date: Fri, 10 Dec 2021 11:14:43 -0800 Subject: [PATCH] Adds `desc-only` option to doxygengroup and doxygennamespace directives. Signed-off-by: Kevin Putnam --- breathe/directives/content_block.py | 1 + breathe/renderer/filter.py | 3 +++ documentation/source/directives.rst | 10 ++++++---- documentation/source/group.rst | 9 +++++++-- documentation/source/namespace.rst | 8 ++++++-- 5 files changed, 23 insertions(+), 8 deletions(-) diff --git a/breathe/directives/content_block.py b/breathe/directives/content_block.py index 6fb6c3790..7f9d5b8e8 100644 --- a/breathe/directives/content_block.py +++ b/breathe/directives/content_block.py @@ -27,6 +27,7 @@ class _DoxygenContentBlockDirective(BaseDirective): "private-members": flag, "undoc-members": flag, "no-link": flag, + "desc-only": flag, } has_content = False diff --git a/breathe/renderer/filter.py b/breathe/renderer/filter.py index a7267c5a6..31f90ce31 100644 --- a/breathe/renderer/filter.py +++ b/breathe/renderer/filter.py @@ -596,6 +596,9 @@ def create_render_filter(self, kind: str, options: Dict[str, Any]) -> Filter: if "members" in filter_options: filter_options["members"] = "" + if "desc-only" in filter_options: + return self._create_description_filter(True, "compounddef", options) + node = Node() grandparent = Ancestor(2) has_grandparent = HasAncestorFilter(2) diff --git a/documentation/source/directives.rst b/documentation/source/directives.rst index 3ebb6847a..3683fa4ad 100644 --- a/documentation/source/directives.rst +++ b/documentation/source/directives.rst @@ -228,8 +228,8 @@ group. A doxygen group can be declared with specific doxygen markup in the source comments as covered in the `doxygen grouping documentation`_. It takes the standard ``project``, ``path``, ``outline`` and ``no-link`` options -and additionally the ``content-only``, ``members``, ``protected-members``, -``private-members`` and ``undoc-members`` options. +and additionally the ``content-only``, ``desc-only``, ``members``, +``protected-members``, ``private-members`` and ``undoc-members`` options. :: @@ -237,6 +237,7 @@ and additionally the ``content-only``, ``members``, ``protected-members``, :project: ... :path: ... :content-only: + :desc-only: :outline: :members: :protected-members: @@ -307,8 +308,8 @@ doxygennamespace This directive generates the appropriate output for the contents of a namespace. It takes the standard ``project``, ``path``, ``outline`` and ``no-link`` options -and additionally the ``content-only``, ``members``, ``protected-members``, -``private-members`` and ``undoc-members`` options. +and additionally the ``content-only``, ``desc-only``, ``members``, +``protected-members``, ``private-members`` and ``undoc-members`` options. To reference a nested namespace, the full namespaced path must be provided, e.g. ``foo::bar`` for the ``bar`` namespace inside the ``foo`` namespace. @@ -319,6 +320,7 @@ To reference a nested namespace, the full namespaced path must be provided, e.g. :project: ... :path: ... :content-only: + :desc-only: :outline: :members: :protected-members: diff --git a/documentation/source/group.rst b/documentation/source/group.rst index 6e0068274..5bd841d04 100644 --- a/documentation/source/group.rst +++ b/documentation/source/group.rst @@ -9,8 +9,9 @@ group. A doxygen group can be declared with specific doxygen markup in the source comments as cover in the `doxygen grouping documentation`_. It takes the standard ``project``, ``path``, ``outline`` and ``no-link`` options -and additionally the ``content-only``, ``members``, ``protected-members``, -``private-members``, ``undoc-members`` and ``inner`` options. +and additionally the ``content-only``, ``desc-only``, ``members``, +``protected-members``, ``private-members``, ``undoc-members`` and ``inner`` +options. ``content-only`` If this flag is specified, then the directive does not output the name of the @@ -18,6 +19,10 @@ and additionally the ``content-only``, ``members``, ``protected-members``, This can be useful if the groups are only used for organizational purposes and not to provide additional information. +``desc-only`` + If specified, only the description and name of the group will be + displayed. + ``members`` If specified, the public members of any classes in the group output will be displayed. Unlike the ``doxygenclass`` ``members`` option, this does not diff --git a/documentation/source/namespace.rst b/documentation/source/namespace.rst index 2aaf420d1..87c12c46b 100644 --- a/documentation/source/namespace.rst +++ b/documentation/source/namespace.rst @@ -8,8 +8,8 @@ This directive generates the appropriate output for the contents of a namespace. It takes the standard ``project``, ``path``, ``outline`` and ``no-link`` options -and additionally the ``content-only``, ``members``, ``protected-members``, -``private-members`` and ``undoc-members`` options. +and additionally the ``content-only``, ``desc-only``, ``members``, +``protected-members``, ``private-members`` and ``undoc-members`` options. ``content-only`` If this flag is specified, then the directive does not output the name of the @@ -17,6 +17,10 @@ and additionally the ``content-only``, ``members``, ``protected-members``, the namespace. This can be useful for structuring your documentation but leaving out the namespace declaration itself which is often undocumented. +``desc-only`` + If specified, only the description and name of the namespace will be + displayed. + ``members`` If specified, the public members of any classes in the namespace output will be displayed. Unlike the ``doxygenclass`` ``members`` option, this does not