From 0d525a3e9366f744edeb327fec94928305b27cc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 7 May 2020 14:59:24 +0200 Subject: man: add specifiers section to directives index The hack with getparent().txt is not very pretty, but the whole thing seems to work well enough. It is useful to figure out whihc specifiers are supported where. --- tools/make-directive-index.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tools') diff --git a/tools/make-directive-index.py b/tools/make-directive-index.py index 26561a2456..c6b2173b2e 100755 --- a/tools/make-directive-index.py +++ b/tools/make-directive-index.py @@ -87,6 +87,15 @@ def _extract_directives(directive_groups, formatting, page): storfile[name.text].append((pagename, section)) formatting[name.text] = name + storfile = directive_groups['specifiers'] + for name in t.iterfind(".//table[@class='specifiers']//entry/literal"): + if name.text[0] != '%' or name.getparent().text is not None: + continue + if name.attrib.get('index') == 'false': + continue + storfile[name.text].append((pagename, section)) + formatting[name.text] = name + def _make_section(template, name, directives, formatting): varlist = template.find(".//*[@id='{}']".format(name)) for varname, manpages in sorted(directives.items()): -- cgit v1.2.1