/protodoc

Generate a markdown document for a Protobuf file.

Primary LanguageGoApache License 2.0Apache-2.0

protodoc

Generate a markdown document for a Protobuf file.

Usage:

go get -u github.com/aclisp/protodoc
protodoc demo.proto > demo.md

Example

See demo.md

Design

The Protobuf file generally has four sections:

  1. Service definitions, containing RPC methods
  2. Enumerations
  3. User defined types, called object
  4. RPC Request and Response objects

When generating a markdown document,

  • <1> and <4> are combined together
  • <2> and <3> are referenced by <4>

Inspired by protobuf 为经络,gRPC为骨架.

Limitation

Only a subset of proto3 is supported as for best practice.