Skip to content

Commit

Permalink
chore: update API reference doc (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdh authored Apr 22, 2024
1 parent 192820a commit 8028b5a
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ proto: ## Generate the protobuf files
help:
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

update-swagger-md:
@echo "> updating reference api docs"
@npx swagger-markdown -i proto/apidocs.swagger.json -o docs/docs/reference/api.md
doc: clean-doc ## Generate api and cli documentation
@echo "> generate cli docs"
@go run . reference --plain | sed '1 s,.*,# CLI,' > ./docs/docs/reference/cli.md
@echo ">generate api docs"
@cd $(CURDIR)/docs/docs; yarn docusaurus clean-api-docs all; yarn docusaurus gen-api-docs all
@echo "> format api docs"
@npx prettier --write $(CURDIR)/docs/docs/apis/*.mdx

doc-build: ## Run documentation locally
@echo "> building docs"
@cd $(CURDIR)/docs/docs; yarn start
47 changes: 47 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Website

This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

```
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
```

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.

### API References

To remove all the auto-generated API reference markdowns:

```
yarn docusaurus clean-api-docs all
```

To generate all the API references:

```
yarn docusaurus gen-api-docs all
```

0 comments on commit 8028b5a

Please sign in to comment.