diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 047618f956..0a4d278001 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -47,6 +47,9 @@ jobs: "https://github.com/terrastruct/d2/releases/download/${D2_VERSION}/d2-${D2_VERSION}-linux-amd64.tar.gz" tar xzf /tmp/d2.tar.gz -C /tmp/d2 --strip-components=1 cp /tmp/d2/bin/d2 /usr/local/bin + # Can remove and swap to swagger-http once they add https://github.com/mkdocs/mkdocs/pull/3851 + - name: Download API Schema + run: curl -o docs/openapi.json -L "https://api.linuxserver.io/openapi.json" - name: Install dependencies run: pip install -r docs/requirements.txt - name: Generate images-by-category.md @@ -96,6 +99,9 @@ jobs: "https://github.com/terrastruct/d2/releases/download/${D2_VERSION}/d2-${D2_VERSION}-linux-amd64.tar.gz" tar xzf /tmp/d2.tar.gz -C /tmp/d2 --strip-components=1 cp /tmp/d2/bin/d2 /usr/local/bin + # Can remove and swap to swagger-http once they add https://github.com/mkdocs/mkdocs/pull/3851 + - name: Download API Schema + run: curl -o docs/openapi.json -L "https://api.linuxserver.io/openapi.json" - name: Install dependencies run: pip install -r docs/requirements.txt - name: Generate images-by-category.md diff --git a/Dockerfile b/Dockerfile index 0391359ded..fb093a9ce7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,8 @@ RUN \ python3 && \ mkdir -p /app/mkdocs/docs && \ git config --global --add safe.directory /app/mkdocs && \ + # Can remove and swap to swagger-http once they add https://github.com/mkdocs/mkdocs/pull/3851 + curl -o /app/mkdocs/docs/openapi.json -L "https://api.linuxserver.io/openapi.json" && \ python3 -m venv /lsiopy && \ pip install -U --no-cache-dir \ pip \ diff --git a/docs/.pages b/docs/.pages index 76bab59fed..a0ebbea929 100644 --- a/docs/.pages +++ b/docs/.pages @@ -5,5 +5,6 @@ nav: - Images by Category: images-by-category.md - Images: images - Deprecated Images: deprecated_images + - API: API.md - Frequently Asked Questions: FAQ.md - misc diff --git a/docs/API.md b/docs/API.md new file mode 100644 index 0000000000..8d73bb4f7b --- /dev/null +++ b/docs/API.md @@ -0,0 +1,7 @@ +--- +hide: + - navigation +--- + +# +!!swagger openapi.json!! diff --git a/docs/requirements.txt b/docs/requirements.txt index 9a13b8fae2..9446a10857 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -4,3 +4,4 @@ mkdocs-git-revision-date-localized-plugin==1.3.0 mkdocs-material==9.5.50 mkdocs-minify-plugin==0.8.0 mkdocs-redirects==1.2.2 +mkdocs-render-swagger-plugin==0.1.2 diff --git a/mkdocs.yml b/mkdocs.yml index c81746c5c3..9d26d63fe9 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -93,6 +93,7 @@ plugins: enable_creation_date: true - minify: minify_html: true + - render_swagger - search - tags: tags: false