From b24e138da7b65c83b15e66137d8ed23cc545e386 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 1 Aug 2022 14:41:00 +0200 Subject: [PATCH] m.dox: document a rather nasty abuse of lack of python variable scoping. --- plugins/m/dox.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/m/dox.py b/plugins/m/dox.py index 7af7db0a..456d0d11 100644 --- a/plugins/m/dox.py +++ b/plugins/m/dox.py @@ -121,7 +121,10 @@ def init(tagfiles, input): for value in member.findall('enumvalue'): symbol_mapping[enumeration + '::' + value.text] = (None, link + '#' + value.attrib['anchor'], css_classes) - # Sections + # Sections. While rather strange, these reuse the `link` + # variable defined by whatever came earlier --- because pages + # have it with implicit `.html` but e.g. files with explicit + # `.html`. TODO: fix more robustly for section in child.findall('docanchor'): symbol_mapping[section.text] = (section.attrib.get('title', ''), link + '#' + section.text, css_classes) -- 2.30.2