From 36745dfd5e2763d63c2552e0fcceafa0d74c594b Mon Sep 17 00:00:00 2001 From: Antoine Date: Sun, 18 Aug 2024 18:44:58 +0200 Subject: [PATCH] (sort python imports) --- extra/pygment/lexer.py | 3 ++- extra/sphinx/preprocessedCodeBlock.py | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/extra/pygment/lexer.py b/extra/pygment/lexer.py index ed308d4..d9af669 100644 --- a/extra/pygment/lexer.py +++ b/extra/pygment/lexer.py @@ -1,6 +1,7 @@ -from pygments.lexer import RegexLexer, bygroups, words, include +from pygments.lexer import RegexLexer, bygroups, include, words from pygments.token import * + class CustomLexer(RegexLexer): name = 'Prepro' aliases = ['prepro'] diff --git a/extra/sphinx/preprocessedCodeBlock.py b/extra/sphinx/preprocessedCodeBlock.py index 1afe89c..08f61ea 100644 --- a/extra/sphinx/preprocessedCodeBlock.py +++ b/extra/sphinx/preprocessedCodeBlock.py @@ -3,14 +3,14 @@ from docutils import nodes from docutils.parsers.rst import directives +from myst_parser.parsers.docutils_ import Parser as MystParser + from sphinx.application import Sphinx -from sphinx.util.docutils import SphinxDirective -from sphinx.util.typing import ExtensionMetadata from sphinx.directives.code import LiteralInclude from sphinx.directives.other import Include -#from docutils.parsers.rst.directives.misc import Include +from sphinx.util.docutils import SphinxDirective +from sphinx.util.typing import ExtensionMetadata -from myst_parser.parsers.docutils_ import Parser as MystParser def create_sphinx_design_component(name: str, classes: list[str], rawtext: str = ""): return nodes.container(rawtext, is_div=True, design_component=name, classes=classes)