From 87df1130bd837e3212335593bb2f130c44940bb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8D=C3=B1igo=20Huguet?= Date: Fri, 11 Aug 2023 12:37:01 +0200 Subject: [PATCH] docs: allow to skip values in "enumval expansion" When using "enumval expansion" in documentation comments (i.e. "#IPTunnelMode:*"), sometimes there are values that are only for internal usage, and not intended to be used from public APIs. Sometimes this value is even rejected when trying to set it from public APIs. Allow to prevent values from appearing in public APIs documentation, marking it with the custom annotation "(attribute NM.internal=1)". Note: currently, gtkdoc doesn't support annotations on enum fields when using the inline style "@ENUM_VALUE_NAME: description". Instead, a docblock needs to be used: enum EnumTypeName { /** * ENUM_VALUE_NAME: (attributes NM.internal=1) * * description */ ENUM_VALUE_NAME ... } --- tools/generate-docs-nm-property-infos.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/generate-docs-nm-property-infos.py b/tools/generate-docs-nm-property-infos.py index a6e7d55820..b165fda637 100755 --- a/tools/generate-docs-nm-property-infos.py +++ b/tools/generate-docs-nm-property-infos.py @@ -70,6 +70,9 @@ def init_enumvals(girxml): enum_cname = enum.attrib[type_key] enums[enum_cname] = [] for enumval in enum.findall("./gi:member", ns_map): + if enumval.find('./gi:attribute[@name="NM.internal"]', ns_map) is not None: + continue + cname = enumval.attrib[identifier_key] num_val = enumval.attrib["value"] doc = enumval.find("./gi:doc", ns_map) @@ -88,6 +91,9 @@ def init_enumvals(girxml): enum_cname = enum.attrib[type_key] enums[enum_cname] = [] for enumval in enum.findall("./gi:member", ns_map): + if enumval.find('./gi:attribute[@name="NM.internal"]', ns_map) is not None: + continue + cname = enumval.attrib[identifier_key] num_val = int(enumval.attrib["value"]) doc = enumval.find("./gi:doc", ns_map)