protoc-gen-markdown
is a plugin for protoc
which generates GitHub-flavored markdown
(GFM) from proto files.
By default, it will include validation defined by protovalidate.
It can also generate Mermaid diagrams via additional flags.
buf generate ./example/protos
# Standard usage
protoc -I./example/protos/ \
--markdown_out=paths=source_relative:./example/output/ \
models/models.proto \
service/service.proto
# Mermaid variant
protoc -I./example/protos/ \
--markdown_out=mermaid=true,paths=source_relative:./example/output/ \
models/models.proto \
service/service.proto
# Exclude validation details
protoc -I./example/protos/ \
--markdown_out=protovalidate=false,paths=source_relative:./example/output/ \
models/models.proto \
service/service.proto