Skip to content

Commit 8cd4ccd

Browse files
authored
Add API (#299)
1 parent a6a9768 commit 8cd4ccd

File tree

6 files changed

+18
-0
lines changed

6 files changed

+18
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ jobs:
4747
"https://github.com/terrastruct/d2/releases/download/${D2_VERSION}/d2-${D2_VERSION}-linux-amd64.tar.gz"
4848
tar xzf /tmp/d2.tar.gz -C /tmp/d2 --strip-components=1
4949
cp /tmp/d2/bin/d2 /usr/local/bin
50+
# Can remove and swap to swagger-http once they add https://github.com/mkdocs/mkdocs/pull/3851
51+
- name: Download API Schema
52+
run: curl -o docs/openapi.json -L "https://api.linuxserver.io/openapi.json"
5053
- name: Install dependencies
5154
run: pip install -r docs/requirements.txt
5255
- name: Generate images-by-category.md
@@ -96,6 +99,9 @@ jobs:
9699
"https://github.com/terrastruct/d2/releases/download/${D2_VERSION}/d2-${D2_VERSION}-linux-amd64.tar.gz"
97100
tar xzf /tmp/d2.tar.gz -C /tmp/d2 --strip-components=1
98101
cp /tmp/d2/bin/d2 /usr/local/bin
102+
# Can remove and swap to swagger-http once they add https://github.com/mkdocs/mkdocs/pull/3851
103+
- name: Download API Schema
104+
run: curl -o docs/openapi.json -L "https://api.linuxserver.io/openapi.json"
99105
- name: Install dependencies
100106
run: pip install -r docs/requirements.txt
101107
- name: Generate images-by-category.md

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ RUN \
1818
python3 && \
1919
mkdir -p /app/mkdocs/docs && \
2020
git config --global --add safe.directory /app/mkdocs && \
21+
# Can remove and swap to swagger-http once they add https://github.com/mkdocs/mkdocs/pull/3851
22+
curl -o /app/mkdocs/docs/openapi.json -L "https://api.linuxserver.io/openapi.json" && \
2123
python3 -m venv /lsiopy && \
2224
pip install -U --no-cache-dir \
2325
pip \

docs/.pages

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ nav:
55
- Images by Category: images-by-category.md
66
- Images: images
77
- Deprecated Images: deprecated_images
8+
- API: API.md
89
- Frequently Asked Questions: FAQ.md
910
- misc

docs/API.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
hide:
3+
- navigation
4+
---
5+
6+
#
7+
!!swagger openapi.json!!

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ mkdocs-git-revision-date-localized-plugin==1.3.0
44
mkdocs-material==9.5.50
55
mkdocs-minify-plugin==0.8.0
66
mkdocs-redirects==1.2.2
7+
mkdocs-render-swagger-plugin==0.1.2

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ plugins:
9393
enable_creation_date: true
9494
- minify:
9595
minify_html: true
96+
- render_swagger
9697
- search
9798
- tags:
9899
tags: false

0 commit comments

Comments
 (0)