From f38d5a6a26f889c59a739f35fc2883aab914feb8 Mon Sep 17 00:00:00 2001 From: Lauryn Menard Date: Tue, 31 Jan 2023 18:45:04 +0100 Subject: [PATCH] templates: Remove `base_path` argument from api_return_values_generator. Removes `base_path` argument when making the markdown extension for return values in documentation for API endpoints. This seems to have been a copy and paste error in commit d2ee99a2fdbc1 when `zerver/lib/markdown/api_return_values_generator.py` was created. --- zerver/lib/markdown/api_return_values_table_generator.py | 5 +---- zerver/lib/templates.py | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/zerver/lib/markdown/api_return_values_table_generator.py b/zerver/lib/markdown/api_return_values_table_generator.py index 0528367197..dca655f4bc 100644 --- a/zerver/lib/markdown/api_return_values_table_generator.py +++ b/zerver/lib/markdown/api_return_values_table_generator.py @@ -16,9 +16,6 @@ REGEXP = re.compile(r"\{generate_return_values_table\|\s*(.+?)\s*\|\s*(.+)\s*\}" class MarkdownReturnValuesTableGenerator(Extension): - def __init__(self, configs: Mapping[str, Any] = {}) -> None: - self.config: Dict[str, Any] = {} - def extendMarkdown(self, md: markdown.Markdown) -> None: md.preprocessors.register( APIReturnValuesTablePreprocessor(md, self.getConfigs()), @@ -225,4 +222,4 @@ class APIReturnValuesTablePreprocessor(Preprocessor): def makeExtension(*args: Any, **kwargs: str) -> MarkdownReturnValuesTableGenerator: - return MarkdownReturnValuesTableGenerator(kwargs) + return MarkdownReturnValuesTableGenerator(*args, **kwargs) diff --git a/zerver/lib/templates.py b/zerver/lib/templates.py index fdd9182213..edbeb049fc 100644 --- a/zerver/lib/templates.py +++ b/zerver/lib/templates.py @@ -122,9 +122,7 @@ def render_markdown_path( zerver.lib.markdown.api_arguments_table_generator.makeExtension( base_path="templates/zerver/api/" ), - zerver.lib.markdown.api_return_values_table_generator.makeExtension( - base_path="templates/zerver/api/" - ), + zerver.lib.markdown.api_return_values_table_generator.makeExtension(), zerver.lib.markdown.nested_code_blocks.makeExtension(), zerver.lib.markdown.tabbed_sections.makeExtension(), zerver.lib.markdown.help_settings_links.makeExtension(),