From 30682241c760a968b1138a9a68c1ed6865c2248a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yago=20Gonz=C3=A1lez?= Date: Sat, 26 May 2018 21:46:55 +0200 Subject: [PATCH] api docs: Move OpenAPI files to zerver/openapi. --- zerver/lib/bugdown/api_arguments_table_generator.py | 2 ++ {static => zerver}/openapi/zulip-2.0.yaml | 0 {static => zerver}/openapi/zulip.yaml | 0 zerver/templatetags/app_filters.py | 3 ++- 4 files changed, 4 insertions(+), 1 deletion(-) rename {static => zerver}/openapi/zulip-2.0.yaml (100%) rename {static => zerver}/openapi/zulip.yaml (100%) diff --git a/zerver/lib/bugdown/api_arguments_table_generator.py b/zerver/lib/bugdown/api_arguments_table_generator.py index f25f339cb6..f064383b25 100644 --- a/zerver/lib/bugdown/api_arguments_table_generator.py +++ b/zerver/lib/bugdown/api_arguments_table_generator.py @@ -16,6 +16,8 @@ class MarkdownArgumentsTableGenerator(Extension): configs = {} self.config = { 'base_path': ['.', 'Default location from which to evaluate relative paths for the JSON files.'], + 'openapi_path': ['../../../zerver/openapi', + 'Default location from which to evaluate relative paths for the YAML files.'] } for key, value in configs.items(): self.setConfig(key, value) diff --git a/static/openapi/zulip-2.0.yaml b/zerver/openapi/zulip-2.0.yaml similarity index 100% rename from static/openapi/zulip-2.0.yaml rename to zerver/openapi/zulip-2.0.yaml diff --git a/static/openapi/zulip.yaml b/zerver/openapi/zulip.yaml similarity index 100% rename from static/openapi/zulip.yaml rename to zerver/openapi/zulip.yaml diff --git a/zerver/templatetags/app_filters.py b/zerver/templatetags/app_filters.py index f386043ffb..109166ec10 100644 --- a/zerver/templatetags/app_filters.py +++ b/zerver/templatetags/app_filters.py @@ -96,7 +96,8 @@ def render_markdown_path(markdown_file_path: str, context: Optional[Dict[Any, An ), zerver.lib.bugdown.fenced_code.makeExtension(), zerver.lib.bugdown.api_arguments_table_generator.makeExtension( - base_path='templates/zerver/api/'), + base_path='templates/zerver/api/', + openapi_path='zerver/openapi'), zerver.lib.bugdown.api_code_examples.makeExtension(), zerver.lib.bugdown.help_settings_links.makeExtension(), ]