[PATCH v3 2/2] doc: conf.py: Show groups in test catalog

Andrea Cervesato <[email protected]>
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
From: Andrea Cervesato <andrea.cervesato-IBi9RG/[email protected]>

Display the groups field from metadata in the generated test catalog
pages. Groups appear after the source link and before the test
description.

Signed-off-by: Andrea Cervesato <andrea.cervesato-IBi9RG/[email protected]>
---
 doc/conf.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/doc/conf.py b/doc/conf.py
index 591c1534dfa7e54b816e88b9eca1dd7fb91df255..c28db7af1622d28ff79d128c73e3e3c9d8dea112 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -394,6 +394,7 @@ def _generate_setup_table(keys):
         'needs_checkpoints',
         'forks_child',
         'tags',
+        'groups',
     ]
     my_keys = {k: v for k, v in keys.items() if k not in exclude}
     if len(my_keys) == 0:
@@ -482,6 +483,15 @@ def generate_test_catalog(_):
                 ''
             ])
 
+        # groups information
+        groups = conf.get('groups', None)
+        if groups:
+            text.extend([
+                '',
+                f"**Groups**: {', '.join(groups)}",
+                ''
+            ])
+
         # test description
         desc = conf.get('doc', None)
         if desc:

-- 
2.51.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.