Skip to content

Commit

Permalink
docs: Add Swagger UI to the API reference page (#10923)
Browse files Browse the repository at this point in the history
  • Loading branch information
changhc authored Apr 15, 2023
1 parent 0a72bbe commit 36f65ec
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -618,23 +618,23 @@ docs/cli/argo.md: $(CLI_PKGS) go.sum server/static/files.go hack/cli/main.go
.PHONY: docs-spellcheck
docs-spellcheck: /usr/local/bin/mdspell
# check docs for spelling mistakes
mdspell --ignore-numbers --ignore-acronyms --en-us --no-suggestions --report $(shell find docs -name '*.md' -not -name upgrading.md -not -name fields.md -not -name upgrading.md -not -name executor_swagger.md -not -path '*/cli/*')
mdspell --ignore-numbers --ignore-acronyms --en-us --no-suggestions --report $(shell find docs -name '*.md' -not -name upgrading.md -not -name fields.md -not -name upgrading.md -not -name swagger.md -not -name executor_swagger.md -not -path '*/cli/*')

/usr/local/bin/markdown-link-check:
npm i -g markdown-link-check

.PHONY: docs-linkcheck
docs-linkcheck: /usr/local/bin/markdown-link-check
# check docs for broken links
markdown-link-check -q -c .mlc_config.json $(shell find docs -name '*.md' -not -name fields.md -not -name executor_swagger.md)
markdown-link-check -q -c .mlc_config.json $(shell find docs -name '*.md' -not -name fields.md -not -name swagger.md -not -name executor_swagger.md)

/usr/local/bin/markdownlint:
npm i -g markdownlint-cli

.PHONY: docs-lint
docs-lint: /usr/local/bin/markdownlint
# lint docs
markdownlint docs --fix --ignore docs/fields.md --ignore docs/executor_swagger.md --ignore docs/cli --ignore docs/walk-through/the-structure-of-workflow-specs.md
markdownlint docs --fix --ignore docs/fields.md --ignore docs/executor_swagger.md --ignore docs/swagger.md --ignore docs/cli --ignore docs/walk-through/the-structure-of-workflow-specs.md

/usr/local/bin/mkdocs:
python -m pip install mkdocs==1.2.4 mkdocs_material==8.1.9 mkdocs-spellcheck==0.2.1
Expand Down
26 changes: 25 additions & 1 deletion docs/swagger.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# API Reference

[Open the Swagger API docs](https://raw.githubusercontent.com/argoproj/argo-workflows/master/api/openapi-spec/swagger.json).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
name="description"
content="SwaggerUI"
/>
<title>SwaggerUI</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/swagger-ui.css" />
</head>
<body>
<div id="swagger-ui"></div>
<script src="https://unpkg.com/[email protected]/swagger-ui-bundle.js" crossorigin></script>
<script>
window.onload = () => {
window.ui = SwaggerUIBundle({
url: "https://raw.githubusercontent.com/argoproj/argo-workflows/master/api/openapi-spec/swagger.json",
dom_id: "#swagger-ui",
});
};
</script>
</body>
</html>

0 comments on commit 36f65ec

Please sign in to comment.