Skip to content

Commit 8028b5a

Browse files
authored
chore: update API reference doc (#42)
1 parent 192820a commit 8028b5a

File tree

2 files changed

+58
-3
lines changed

2 files changed

+58
-3
lines changed

Makefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ proto: ## Generate the protobuf files
5252
help:
5353
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
5454

55-
update-swagger-md:
56-
@echo "> updating reference api docs"
57-
@npx swagger-markdown -i proto/apidocs.swagger.json -o docs/docs/reference/api.md
55+
doc: clean-doc ## Generate api and cli documentation
56+
@echo "> generate cli docs"
57+
@go run . reference --plain | sed '1 s,.*,# CLI,' > ./docs/docs/reference/cli.md
58+
@echo ">generate api docs"
59+
@cd $(CURDIR)/docs/docs; yarn docusaurus clean-api-docs all; yarn docusaurus gen-api-docs all
60+
@echo "> format api docs"
61+
@npx prettier --write $(CURDIR)/docs/docs/apis/*.mdx
62+
63+
doc-build: ## Run documentation locally
64+
@echo "> building docs"
65+
@cd $(CURDIR)/docs/docs; yarn start

docs/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Website
2+
3+
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
4+
5+
### Installation
6+
7+
```
8+
$ yarn
9+
```
10+
11+
### Local Development
12+
13+
```
14+
$ yarn start
15+
```
16+
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
### Build
20+
21+
```
22+
$ yarn build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
### Deployment
28+
29+
```
30+
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
31+
```
32+
33+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
34+
35+
### API References
36+
37+
To remove all the auto-generated API reference markdowns:
38+
39+
```
40+
yarn docusaurus clean-api-docs all
41+
```
42+
43+
To generate all the API references:
44+
45+
```
46+
yarn docusaurus gen-api-docs all
47+
```

0 commit comments

Comments
 (0)