chiark / gitweb /
m.dox: minor cleanup.
authorVladimír Vondruš <mosra@centrum.cz>
Thu, 22 Aug 2019 20:20:39 +0000 (22:20 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Sun, 25 Aug 2019 10:38:27 +0000 (12:38 +0200)
plugins/m/dox.py

index 2ce5ec71ce8dbc0ad8a189120df3ef60eaf19b17..be765c6449cff8e3fab012b76230577fbcb5221f 100644 (file)
@@ -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<title>.*) <(?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', []))