From 2e109bb3ff71dbdb675fce7e0cfc62467604e933 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 11 Dec 2017 02:13:19 +0100 Subject: [PATCH] Move the ansilexer code out of the "m" plugins, as it's not a plugin. --- doxygen/dox2html5.py | 6 +++--- pelican-plugins/{m => }/ansilexer.py | 0 pelican-plugins/m/code.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename pelican-plugins/{m => }/ansilexer.py (100%) 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 -- 2.30.2