1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 23:59:45 +02:00

Docs/v0.5.0 second pass (#496)

* update docs

* use auto-gen routes

* dumb deps

* remove whitespace

* github action to build dev docs container

* no cache

Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
Hayden 2021-06-11 21:57:59 -08:00 committed by GitHub
parent 06ed377c00
commit e34079673c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 555 additions and 508 deletions

View file

@ -36,6 +36,7 @@ class AppRoutes:
self.recipes_summary_uncategorized = "/api/recipes/summary/uncategorized"
self.recipes_summary_untagged = "/api/recipes/summary/untagged"
self.recipes_tag = "/api/recipes/tag"
self.recipes_test_scrape_url = "/api/recipes/test-scrape-url"
self.shopping_lists = "/api/shopping-lists"
self.site_settings = "/api/site-settings"
self.site_settings_custom_pages = "/api/site-settings/custom-pages"

View file

@ -0,0 +1,7 @@
{% for api in files.files %}
import { {{ api }}API } from "./{{api}}.js" {% endfor %}
export const api = {
{% for api in files.files %}
{{api}}: {{api}}API, {% endfor %}
}

View file

@ -0,0 +1,19 @@
// This Content is Auto Generated
import { API_ROUTES } from "./apiRoutes"
export const {{paths.export_name}}API = { {% for path in paths.all_paths %} {% for verb in path.http_verbs %} {% if path.route_object.is_function %}
/** {{ verb.js_docs }} {% for v in path.route_object.var %}
* @param {{ v }} {% endfor %}
*/
{{ verb.summary_camel }}({{path.route_object.var|join(", ")}}) {
const response = await apiReq.{{ verb.request_type.value }}(API_ROUTES.{{ path.route_object.router_camel }}({{path.route_object.var|join(", ")}}))
return response.data
}, {% else %}
/** {{ verb.js_docs }} {% for v in path.route_object.var %}
* @param {{ v }} {% endfor %}
*/
{{ verb.summary_camel }}() {
const response = await apiReq.{{ verb.request_type.value }}(API_ROUTES.{{ path.route_object.router_camel }})
return response.data
},{% endif %} {% endfor %} {% endfor %}
}

View file

@ -0,0 +1,7 @@
// This Content is Auto Generated
const prefix = '{{paths.prefix}}'
export const API_ROUTES = { {% for path in paths.static_paths %}
{{ path.router_camel }}: `${prefix}{{ path.route }}`,{% endfor %}
{% for path in paths.function_paths %}
{{path.router_camel}}: ({{path.var|join(", ")}}) => `${prefix}{{ path.js_route }}`,{% endfor %}
}

View file

@ -0,0 +1,12 @@
# This Content is Auto Generated for Pytest
class AppRoutes:
def __init__(self) -> None:
self.prefix = '{{paths.prefix}}'
{% for path in paths.static_paths %}
self.{{ path.router_slug }} = "{{path.prefix}}{{ path.route }}"{% endfor %}
{% for path in paths.function_paths %}
def {{path.router_slug}}(self, {{path.var|join(", ")}}):
return f"{self.prefix}{{ path.route }}"
{% endfor %}