openapi in readthedocs

This commit is contained in:
Xi Yan 2024-11-22 16:41:43 -08:00
parent 900b0556e7
commit 72a0dbb15a
4 changed files with 27 additions and 0 deletions

View file

@ -7,3 +7,5 @@ sphinx-pdj-theme
sphinx-copybutton
sphinx-tabs
sphinx-design
sphinxcontrib-openapi
sphinxcontrib-redoc

View file

@ -0,0 +1,7 @@
# API Reference
```{eval-rst}
.. sphinxcontrib-redoc:: ../resources/llama-stack-spec.yaml
:page-title: API Reference
:expand-responses: all
```

View file

@ -25,6 +25,8 @@ extensions = [
"sphinx_copybutton",
"sphinx_tabs.tabs",
"sphinx_design",
# "sphinxcontrib.openapi",
"sphinxcontrib.redoc",
]
myst_enable_extensions = ["colon_fence"]
@ -82,3 +84,18 @@ html_theme_options = {
html_static_path = ["../_static"]
# html_logo = "../_static/llama-stack-logo.png"
html_style = "../_static/css/my_theme.css"
redoc = [
{
"name": "Llama Stack API",
"page": "api_reference/index",
"spec": "../resources/llama-stack-spec.yaml",
"opts": {
"suppress-warnings": True,
# "expand-responses": ["200", "201"],
},
"embed": True,
},
]
redoc_uri = "https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"

View file

@ -97,4 +97,5 @@ concepts/index
distributions/index
contributing/index
distribution_dev/index
api_reference/index
```