From d818d4a6b53b62607f0f9fba9ca9eac3f46caa09 Mon Sep 17 00:00:00 2001 From: Daniel Foerster Date: Sat, 30 Dec 2023 12:23:10 -0600 Subject: [PATCH] Consistency in ordering of JinjaMarkdownStep kw args (#72) --- src/anchovy/jinja.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/anchovy/jinja.py b/src/anchovy/jinja.py index 31933ce..868fb27 100644 --- a/src/anchovy/jinja.py +++ b/src/anchovy/jinja.py @@ -124,6 +124,8 @@ def __init__(self, Additionally, all frontmatter keys will be included, rendered markdown will be added as `'rendered_markdown'`, and wordcount data will be added as a `'wordcount'` dict if enabled. + :param frontmatter_parser: The name of the frontmatter parser to use, + or a function capable of parsing frontmatter from a string. :param container_types: A list of tuples pairing a HTML tag or None with a list of container names that should render to that HTML tag. If the HTML tag is none, the default raw `
` renderer from @@ -139,8 +141,6 @@ def __init__(self, :param auto_typography: Whether to enable smartquotes and replacement functionalities in markdown-it-py. :param code_highlighting: Whether to enable code highlighting. - :param frontmatter_parser: The name of the frontmatter parser to use, - or a function capable of parsing frontmatter from a string. :param footnotes: Whether to enable the `mdit_py_plugins.footnote` plugin. :param pygments_params: Parameters to supply to @@ -150,13 +150,13 @@ def __init__(self, """ super().__init__(jinja_env, jinja_globals) self.default_template = default_template + self.frontmatter_parser = frontmatter_parser self.container_types = container_types or [] self.container_renderers = container_renderers or {} self.substitutions = substitutions or {} self.auto_anchors = auto_anchors self.auto_typography = auto_typography self.code_highlighting = code_highlighting - self.frontmatter_parser = frontmatter_parser self.footnotes = footnotes self.pygments_params = pygments_params or {} self.wordcount = wordcount @@ -243,6 +243,7 @@ def _build_processor(self): md_rendering.AnchovyRendererHTML, processor.renderer ).set_front_matter_parser(get_frontmatter_parser(self.frontmatter_parser)) + front_matter_plugin(processor) processor.enable(['strikethrough', 'table']) if self.auto_typography: @@ -253,7 +254,6 @@ def _build_processor(self): attrs_block_plugin(processor) if self.footnotes: footnote_plugin(processor) - front_matter_plugin(processor) if self.wordcount: wordcount_plugin(processor)