Skip to content

Commit

Permalink
added OpenAPI docs
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
  • Loading branch information
bigcat88 committed Jul 6, 2024
1 parent 7a19611 commit 2d65585
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ jobs:
- name: Install Docs dependencies
run: python3 -m pip install -r requirements.txt

- name: Download Swagger UI
run: |
wget https://github.com/swagger-api/swagger-ui/archive/refs/tags/v5.17.14.zip
unzip v5.17.14.zip -d swagger-ui
mv swagger-ui/swagger-ui-5.17.14/dist/ docs/swagger-ui
rm -rf v5.17.14.zip
- name: Build flows for each version
run: |
set -e
Expand Down Expand Up @@ -50,6 +57,8 @@ jobs:
rsync -av "docs/_build/html/" "${docroot}/"
rsync -av "flows_publish/" "${docroot}/"
rsync -av "models_catalog.json" "${docroot}/"
rsync -av "docs/swagger-ui/" "${docroot}/swagger-ui/"
rsync -av "docs/swagger.html" "${docroot}/swagger.html"
pushd "${docroot}"
git init
git remote add deploy "https://token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ For any problems with Visionatrix or suggestions for improvement, go to the [mai
- [Working modes](https://visionatrix.github.io/VixFlowsDocs/WorkingModes.html)
- [Vix Workflows](https://visionatrix.github.io/VixFlowsDocs/VixWorkflows.html)
- [Technical information](https://visionatrix.github.io/VixFlowsDocs/TechnicalInformation.html)
- [OpenAPI](https://visionatrix.github.io/VixFlowsDocs/swagger.html)
8 changes: 4 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Here will leave all docs that is not suitable for Readme file.
ComfyUI2VixMigration.rst
TechnicalInformation.rst

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
Different utilities
"""""""""""""""""""

`Visionatrix OpenAPI Specs <https://visionatrix.github.io/VixFlowsDocs/swagger.html>`_
43 changes: 43 additions & 0 deletions docs/swagger.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
<link rel="stylesheet" type="text/css" href="swagger-ui/swagger-ui.css">
<style>
html {
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}
*,
*:before,
*:after {
box-sizing: inherit;
}

body {
margin: 0;
background: #fafafa;
}
</style>
</head>
<body>
<div id="swagger-ui"></div>
<script src="swagger-ui/swagger-ui-bundle.js" charset="UTF-8"> </script>
<script src="swagger-ui/swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
<script>
window.onload = () => {
window.ui = SwaggerUIBundle({
url: "https://raw.githubusercontent.com/Visionatrix/Visionatrix/main/openapi.json",
dom_id: '#swagger-ui',
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
layout: "StandaloneLayout"
});
};
</script>
</body>
</html>

0 comments on commit 2d65585

Please sign in to comment.