Skip to content

Commit 3435dac

Browse files
committed
Add new OCS API documentation
Signed-off-by: jld3103 <[email protected]>
1 parent f4c96a4 commit 3435dac

File tree

7 files changed

+41
-4
lines changed

7 files changed

+41
-4
lines changed

.gitignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ _build
2929
developer_manual/html_css_design/img
3030
developer_manual/html_css_design/icons.txt
3131

32+
# OpenAPI file
33+
developer_manual/_static/openapi.json
34+
developer_manual/_static/stoplight-elements.js
35+
developer_manual/_static/stoplight-elements.css
36+
3237
# Exclude Eclipse project
3338
.project
3439

@@ -47,4 +52,4 @@ venv
4752
.history/
4853

4954
# JetBrains IDEs
50-
.idea/
55+
.idea/

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "build/openapi-extractor"]
2+
path = build/openapi-extractor
3+
url = https://github.com/nextcloud/openapi-extractor

Makefile

+16-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ user-manual-html:
1313
cd user_manual && make html
1414
@echo "User manual build finished; HTML is updated"
1515

16-
developer-manual-html: icons-docs
16+
developer-manual-html: openapi-spec icons-docs
1717
rm -rf developer_manual/_build/html/com
1818
cd developer_manual && make html
1919
@echo "Developer manual build finished; HTML is updated"
@@ -26,8 +26,22 @@ user-manual-pdf:
2626
cd user_manual && make latexpdf
2727
@echo "User manual build finished; PDF is updated"
2828

29-
icons-docs: clean-icons-docs
29+
get-server-sources:
3030
cd build && sh get-server-sources.sh $(DRONE_BRANCH)
31+
32+
openapi-spec: get-server-sources
33+
git submodule update --init
34+
cd build/openapi-extractor && composer install
35+
cd build && ./openapi-extractor/merge-specs \
36+
--core server/core/openapi.json \
37+
--merged ../developer_manual/_static/openapi.json \
38+
$$(ls server/apps/*/openapi.json)
39+
cd developer_manual/_static && \
40+
wget https://unpkg.com/@stoplight/[email protected]/web-components.min.js -O stoplight-elements.js && \
41+
wget https://unpkg.com/@stoplight/[email protected]/styles.min.css -O stoplight-elements.css
42+
43+
44+
icons-docs: clean-icons-docs get-server-sources
3145
cd build && composer install && composer update
3246
cd build && php generateIconsDoc.php
3347

build/openapi-extractor

Submodule openapi-extractor added at 13d22c9

developer_manual/_static/openapi.html

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<html>
2+
<head>
3+
<title>OCS API</title>
4+
<script src="stoplight-elements.js"></script>
5+
<link rel="stylesheet" href="stoplight-elements.css">
6+
</head>
7+
<body>
8+
<elements-api apiDescriptionUrl="openapi.json" router="hash" hideTryIt="true" logo="logo-blue.png"></elements-api>
9+
</body>
10+
</html>

developer_manual/client_apis/OCS/index.rst

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
OCS API
55
===============================
66

7+
To browse the new OCS API documentation please go `here <../../_static/openapi.html>`_.
8+
9+
The old documentation is still kept as it provides some additional documentation that is not completely covered in the new documentation:
10+
711
.. toctree::
812

913
ocs-api-overview

developer_manual/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
# Add any paths that contain custom static files (such as style sheets) here,
127127
# relative to this directory. They are copied after the builtin static files,
128128
# so a file named "default.css" will overwrite the builtin "default.css".
129-
html_static_path = ['../_shared_assets/static']
129+
html_static_path = ['../_shared_assets/static', '_static']
130130

131131
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
132132
# using the given strftime format.

0 commit comments

Comments
 (0)