pseudomuto / protoc-gen-doc

Documentation generator plugin for Google Protocol Buffers
MIT License
2.63k stars 464 forks source link

Compiling documentation for protos from nested directories #471

Open jbingham94 opened 2 years ago

jbingham94 commented 2 years ago

Hi there,

Was wondering if it's possible to use this library to generate documentation for a structure where protos are nested in different directories, e.g.:

protos/ ├── pets/ │ ├── Dog.proto │ ├── Cat.proto │ ├── Fish.proto ├── food/ │ ├── Kibble.proto │ └── FishFood.proto

Our protos also reference each other. I tried compiling the top level directory in our repo (e.g. protos above) and it failed, and I also tried compiling some of the sub-directories, but that also failed because it failed to understand the reference to other files in the repo. Any assistance you could provide would be most helpful.

SpaceCondor commented 2 years ago

@jbingham94 Were you able to generate documentation? I am in the same situation.

praveenRamalingam commented 2 years ago

protoc -I./protos --doc_out=./doc $(find ./protos -name "*.proto") will get you what you need. you can modify the out and provide opts as usual but the find and the -I are the important pieces

jbingham94 commented 2 years ago

@praveenRamalingam can you explain the -I./protos flag? it's saying it's invalid for me

praveenRamalingam commented 2 years ago

what is your protoc version? -I is your include path. https://linuxcommandlibrary.com/man/protoc

jbingham94 commented 2 years ago

ah okay, I thought you were referencing the command line tool of this library, my mistake. i'll give that a try soon. thanks!