From: Vladimír Vondruš Date: Thu, 22 Aug 2019 20:20:39 +0000 (+0200) Subject: m.dox: minor cleanup. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=a2241f6a2721cfe131346b2357283d9ebfd0af4e;p=blog.git m.dox: minor cleanup. --- diff --git a/plugins/m/dox.py b/plugins/m/dox.py index 2ce5ec71..be765c64 100644 --- a/plugins/m/dox.py +++ b/plugins/m/dox.py @@ -36,7 +36,7 @@ import logging logger = logging.getLogger(__name__) -# Modified from __init__ to add support for queries and hashes +# Modified from abbr / gh / gl / ... to add support for queries and hashes link_regexp = re.compile(r'(?P.*) <(?P<link>[^?#]+)(?P<hash>[?#].+)?>') def parse_link(text): @@ -51,8 +51,6 @@ def parse_link(text): return title, link, hash def init(tagfiles, input): - rst.roles.register_local_role('dox', dox) - global symbol_mapping, symbol_prefixes, tagfile_basenames # Pre-round to populate subclasses. Clear everything in case we init'd @@ -171,6 +169,8 @@ def dox(name, rawtext, text, lineno, inliner: Inliner, options={}, content=[]): return [node], [] def register_mcss(mcss_settings, **kwargs): + rst.roles.register_local_role('dox', dox) + init(input=mcss_settings['INPUT'], tagfiles=mcss_settings.get('M_DOX_TAGFILES', []))