pseudomuto / protoc-gen-doc

Documentation generator plugin for Google Protocol Buffers
MIT License
2.62k stars 462 forks source link

Usage with Prototool #384

Open Arttii opened 5 years ago

Arttii commented 5 years ago

Hi,

I was trying to set this up to generate doc for a few grpc services I have. The general proto build is done using prototool :

 - name: docs
   path: protoc-gen-doc
   output: ../gen/docs/
   flags: html,index.html

Prototool will run smth like:

2019-02-25T14:06:01.321+0100    DEBUG   running protoc  {"command": "/home/arti/.cache/prototool/Linux/x86_64/protobuf/3.6.1/bin/protoc -I proto/tefde-proto/vendor/github.com/grpc-ecosystem/grpc-gateway -I proto/tefde-proto/vendor/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis -I /home/arti/.cache/prototool/Linux/x86_64/protobuf/3.6.1/include -I proto/tefde-proto/proto --docs_out=html,index.html:proto/tefde-proto/gen/docs --plugin=protoc-gen-docs=/opt/tools/protoc-gen-doc proto/org-proto/proto/org/foo/service.proto"}

So in case there are many services the output will be overwritten, and I did not find a way to make the output depend on the folder of the service for example. So the desired behavior would be, to create smth like

proto/tefde-proto/gen/docs/foo/index.html

instead we get:

proto/tefde-proto/gen/docs/index.html

Am I misunderstanding something?