chiark / gitweb /
Move the ansilexer code out of the "m" plugins, as it's not a plugin.
authorVladimír Vondruš <mosra@centrum.cz>
Mon, 11 Dec 2017 01:13:19 +0000 (02:13 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Mon, 11 Dec 2017 01:52:47 +0000 (02:52 +0100)
doxygen/dox2html5.py
pelican-plugins/ansilexer.py [moved from pelican-plugins/m/ansilexer.py with 100% similarity]
pelican-plugins/m/code.py

index 5a43d70884fbbcf6ece7f8720810fa2b94a33c15..b9c68ea03c6044871ac0c1e7bcfd1c49efb79c5d 100755 (executable)
@@ -47,7 +47,7 @@ from pygments.lexers import TextLexer, BashSessionLexer, get_lexer_by_name, find
 sys.path.append("../pelican-plugins")
 import m.latex2svg
 import m.math
-import m.ansilexer
+import ansilexer
 
 xref_id_rx = re.compile(r"""(.*)_1(_[a-z-]+[0-9]+)$""")
 slugify_nonalnum_rx = re.compile(r"""[^\w\s-]""")
@@ -503,7 +503,7 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET.
                        # Pygments knows only .vert, .frag, .geo
                        ('.glsl', 'glsl'),
                        ('.conf', 'ini'),
-                       ('.ansi', m.ansilexer.AnsiLexer)]
+                       ('.ansi', ansilexer.AnsiLexer)]
             for key, v in mapping:
                 if not filename.endswith(key): continue
 
@@ -525,7 +525,7 @@ def parse_desc_internal(state: State, element: ET.Element, immediate_parent: ET.
 
             # Style console sessions differently
             if (isinstance(lexer, BashSessionLexer) or
-                isinstance(lexer, m.ansilexer.AnsiLexer)):
+                isinstance(lexer, ansilexer.AnsiLexer)):
                 class_ = 'm-console'
             else:
                 class_ = 'm-code'
index 40b92be50036f453d2e98d61ae760afd3dfcbeaf..52257d79f0044988f7af73385ea82cf828cd284a 100644 (file)
@@ -40,7 +40,7 @@ import logging
 
 logger = logging.getLogger(__name__)
 
-from . import ansilexer
+import ansilexer
 
 def _highlight(code, language, options):
     # Use our own lexer for ANSI