From: Vladimír Vondruš Date: Mon, 11 Dec 2017 01:13:19 +0000 (+0100) Subject: Move the ansilexer code out of the "m" plugins, as it's not a plugin. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=2e109bb3ff71dbdb675fce7e0cfc62467604e933;p=blog.git Move the ansilexer code out of the "m" plugins, as it's not a plugin. --- diff --git a/doxygen/dox2html5.py b/doxygen/dox2html5.py index 5a43d708..b9c68ea0 100755 --- a/doxygen/dox2html5.py +++ b/doxygen/dox2html5.py @@ -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' diff --git a/pelican-plugins/m/ansilexer.py b/pelican-plugins/ansilexer.py similarity index 100% rename from pelican-plugins/m/ansilexer.py rename to pelican-plugins/ansilexer.py diff --git a/pelican-plugins/m/code.py b/pelican-plugins/m/code.py index 40b92be5..52257d79 100644 --- a/pelican-plugins/m/code.py +++ b/pelican-plugins/m/code.py @@ -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