diff --git a/docs/requirements.txt b/docs/requirements.txt index 464dde187..c182f41c4 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -7,3 +7,5 @@ sphinx-pdj-theme sphinx-copybutton sphinx-tabs sphinx-design +sphinxcontrib-openapi +sphinxcontrib-redoc diff --git a/docs/source/api_reference/index.md b/docs/source/api_reference/index.md new file mode 100644 index 000000000..679bc8e5e --- /dev/null +++ b/docs/source/api_reference/index.md @@ -0,0 +1,7 @@ +# API Reference + +```{eval-rst} +.. sphinxcontrib-redoc:: ../resources/llama-stack-spec.yaml + :page-title: API Reference + :expand-responses: all +``` diff --git a/docs/source/conf.py b/docs/source/conf.py index 152c94563..c63904572 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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" diff --git a/docs/source/index.md b/docs/source/index.md index cf58537bc..771104ef2 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -97,4 +97,5 @@ concepts/index distributions/index contributing/index distribution_dev/index +api_reference/index ```