diff --git a/src/formatitko/formatitko.py b/src/formatitko/formatitko.py index c0ec74d..0456240 100755 --- a/src/formatitko/formatitko.py +++ b/src/formatitko/formatitko.py @@ -11,8 +11,8 @@ from .katex import KatexClient from .html import html from .tex import tex from .images import ImageProcessor -from .output_generator import Output_generator -from .html_generator import HTML_generator +from .output_generator import OutputGenerator +from .html_generator import HTMLGenerator from .mj_show import show @@ -56,7 +56,7 @@ def main(): # Generate HTML and TeX out of the transformed document #open(args.output_html, "w").write(html(doc, katexClient, imageProcessor)) #open(args.output_tex, "w").write(tex(doc, imageProcessor)) - Output_generator(sys.stdout).generate(doc) + OutputGenerator(sys.stdout).generate(doc) if args.debug: print(show(doc)) diff --git a/src/formatitko/html_generator.py b/src/formatitko/html_generator.py index ee5aa5c..5fe7aed 100644 --- a/src/formatitko/html_generator.py +++ b/src/formatitko/html_generator.py @@ -15,15 +15,15 @@ from pygments.util import ClassNotFound from .whitespace import NBSP from .context import Group -from .output_generator import Output_generator +from .output_generator import OutputGenerator from .katex import KatexClient from .images import ImageProcessor from .util import inlinify -class HTML_generator(Output_generator): - def __init__(self, output_file, katex_client: KatexClient, image_processor:ImageProcessor, *args, **kwargs): - self.katex_client = katex_client - self.image_processor = image_processor +class HTMLGenerator(OutputGenerator): + def __init__(self, output_file, katexClient: KatexClient, imageProcessor: ImageProcessor, *args, **kwargs): + self.katexClient = katexClient + self.imageProcessor = imageProcessor super().__init__(output_file, *args, **kwargs) def generate(self, e: Union[Element, ListContainer]): diff --git a/src/formatitko/output_generator.py b/src/formatitko/output_generator.py index 6b39320..7f29779 100644 --- a/src/formatitko/output_generator.py +++ b/src/formatitko/output_generator.py @@ -8,11 +8,11 @@ from .whitespace import NBSP from .transform import FQuoted from .context import Group -class UnknownElementException(Exception): +class UnknownElementError(Exception): "An unknown Element has been passed to the Output_generator, probably because panflute introduced a new one." pass -class Output_generator: +class OutputGenerator: def __init__(self, output_file, indent_str: str="\t", initial_indent_level: int=0): self.output_file = output_file self.indent_str = indent_str @@ -85,7 +85,7 @@ class Output_generator: ListItem: self.generate_ListItem }[type(e)](e) except KeyError: - raise UnknownElementException(type(e)) + raise UnknownElementError(type(e)) def generate_ListContainer(self, e: ListContainer): for child in e: