From ada139844ac3b3d79f3e9baba2acebd54e6cf07b Mon Sep 17 00:00:00 2001 From: Donkie Date: Mon, 3 Apr 2023 19:29:51 +0200 Subject: [PATCH] Added link to the REST API docs --- README.md | 2 ++ spoolman/docs.py | 41 ++++++++++++++++++++--------------------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 1b19bba..60dbf0e 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ these services can e.g. list available spools, report filament consumption, etc. Currently, it has no client GUI, and only operates using HTTP REST commands. +REST API: https://donkie.github.io/Spoolman/ + ## Prerequisites The data can be stored using any async SQLAlchemy supported database: diff --git a/spoolman/docs.py b/spoolman/docs.py index 6a9b2da..6cb1b27 100644 --- a/spoolman/docs.py +++ b/spoolman/docs.py @@ -1,7 +1,7 @@ """Functions for generating documentation.""" -from contextlib import suppress import json +from contextlib import suppress from pathlib import Path from typing import Any @@ -36,7 +36,6 @@ def generate_openapi(app: FastAPI) -> dict[str, Any]: def generate_docs() -> None: """Generate documentation for this service in the docs/ directory.""" - with suppress(FileExistsError): Path("docs").mkdir() @@ -45,23 +44,23 @@ def generate_docs() -> None: with Path("docs", "index.html").open("w") as f: f.write( f""" - - - - Spoolson REST API v1 - ReDoc - - - - - - - -
- - - - """, + + + + Spoolson REST API v1 - ReDoc + + + + + + + +
+ + + + """, )