diff --git a/.gitignore b/.gitignore index f5c18cb03da..b9196717abe 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,11 @@ _build developer_manual/html_css_design/img developer_manual/html_css_design/icons.txt +# OpenAPI file +developer_manual/_static/openapi.json +developer_manual/_static/stoplight-elements.js +developer_manual/_static/stoplight-elements.css + # Exclude Eclipse project .project @@ -47,4 +52,4 @@ venv .history/ # JetBrains IDEs -.idea/ \ No newline at end of file +.idea/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000000..783d98b5ca6 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "build/openapi-extractor"] + path = build/openapi-extractor + url = https://github.com/nextcloud/openapi-extractor diff --git a/Makefile b/Makefile index 9ea1b8106f3..0da2aed82f6 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ user-manual-html: cd user_manual && make html @echo "User manual build finished; HTML is updated" -developer-manual-html: icons-docs +developer-manual-html: openapi-spec icons-docs rm -rf developer_manual/_build/html/com cd developer_manual && make html @echo "Developer manual build finished; HTML is updated" @@ -26,8 +26,31 @@ user-manual-pdf: cd user_manual && make latexpdf @echo "User manual build finished; PDF is updated" -icons-docs: clean-icons-docs +get-server-sources: cd build && sh get-server-sources.sh $(DRONE_BRANCH) + +openapi-spec: get-server-sources + git submodule update --init + cd build/openapi-extractor && composer install + cd build && ./openapi-extractor/merge-specs \ + --core server/core/openapi.json \ + --merged ../developer_manual/_static/openapi.json \ + server/apps/cloud_federation_api/openapi.json \ + server/apps/dashboard/openapi.json \ + server/apps/dav/openapi.json \ + server/apps/files_sharing/openapi.json \ + server/apps/oauth2/openapi.json \ + server/apps/provisioning_api/openapi.json \ + server/apps/settings/openapi.json \ + server/apps/theming/openapi.json \ + server/apps/user_status/openapi.json \ + server/apps/weather_status/openapi.json + cd developer_manual/_static && \ + wget https://unpkg.com/@stoplight/elements@7.7.17/web-components.min.js -O stoplight-elements.js && \ + wget https://unpkg.com/@stoplight/elements@7.7.17/styles.min.css -O stoplight-elements.css + + +icons-docs: clean-icons-docs get-server-sources cd build && composer install && composer update cd build && php generateIconsDoc.php diff --git a/build/openapi-extractor b/build/openapi-extractor new file mode 160000 index 00000000000..13d22c9cc3c --- /dev/null +++ b/build/openapi-extractor @@ -0,0 +1 @@ +Subproject commit 13d22c9cc3cbaa138d7268d48152b74bc4eeda33 diff --git a/developer_manual/_static/openapi.html b/developer_manual/_static/openapi.html new file mode 100644 index 00000000000..f32b3fa520c --- /dev/null +++ b/developer_manual/_static/openapi.html @@ -0,0 +1,10 @@ + +
+