From 4ac9ff9d218219e4dd8c9f605d53c3abd1a5d945 Mon Sep 17 00:00:00 2001 From: ilai Date: Sun, 5 Nov 2023 12:40:29 +0200 Subject: [PATCH] [app] Moved docs template to their own dedicated file Much more readable --- src/canopy_cli/__init__.py | 28 +-------------------------- src/canopy_cli/cli.py | 2 +- src/canopy_server/_redocs_template.py | 27 ++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 28 deletions(-) create mode 100644 src/canopy_server/_redocs_template.py diff --git a/src/canopy_cli/__init__.py b/src/canopy_cli/__init__.py index a4791643..8b137891 100644 --- a/src/canopy_cli/__init__.py +++ b/src/canopy_cli/__init__.py @@ -1,27 +1 @@ -HTML_TEMPLATE = """ - - - - Canopy API Spec - - - - - - - -
- Redoc - - - - -""" # noqa: E501 + diff --git a/src/canopy_cli/cli.py b/src/canopy_cli/cli.py index ecd691c7..5a181a5c 100644 --- a/src/canopy_cli/cli.py +++ b/src/canopy_cli/cli.py @@ -593,7 +593,7 @@ def api_docs(url): if generated_docs: import json - from canopy_cli import HTML_TEMPLATE + from canopy_server._redocs_template import HTML_TEMPLATE from canopy_server.app import app # generate docs diff --git a/src/canopy_server/_redocs_template.py b/src/canopy_server/_redocs_template.py new file mode 100644 index 00000000..a4791643 --- /dev/null +++ b/src/canopy_server/_redocs_template.py @@ -0,0 +1,27 @@ +HTML_TEMPLATE = """ + + + + Canopy API Spec + + + + + + + +
+ Redoc + + + + +""" # noqa: E501