Skip to content

Added API docs generation instructions to README.md #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,36 @@ foundryup
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
```

### Generate API Docs from Proto Files
1. Install the `protoc-gen-doc` plugin for `protoc`.
Install via Go:
```
go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest
```
Ensure the plugin is in your PATH:
```
export PATH="$PATH:$(go env GOPATH)/bin"
```
Verify the plugin is installed:
```
which protoc-gen-doc
```
2. Generate API references in HTML format
```
protoc --doc_out=./docs --doc_opt=html,docs.html ./protobuf/avs.proto
```

3. Alternatively, generate API references in Markdown format
```
protoc --doc_out=./docs --doc_opt=markdown,docs.md ./protobuf/avs.proto
```
This command will generate a markdown version of the gRPC API documentation. To enhance the clarity of the generated documentation, the following improvements should be made to the .proto file:
- **Group Definitions by Command**: Organize the API methods and their descriptions by command categories to make it easier for users to find relevant information.
- **Elaborate on Input Fields**: Provide detailed descriptions for each input field, including data types, expected values, and any constraints or special considerations.
- **Add Examples**: Include usage examples for each API method to demonstrate how to construct requests and interpret responses.
- **Link to Related Resources**: Where applicable, link to additional resources or documentation that provide further context or implementation details.


## Getting started

Coming soon
Expand Down