Skip to content
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

Compiling documentation for protos from nested directories #471

Open
jbingham94 opened this issue Feb 6, 2022 · 5 comments
Open

Compiling documentation for protos from nested directories #471

jbingham94 opened this issue Feb 6, 2022 · 5 comments

Comments

@jbingham94
Copy link

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
Copy link

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

@praveenRamalingam
Copy link

praveenRamalingam commented Mar 2, 2022

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
Copy link
Author

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

@praveenRamalingam
Copy link

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

@jbingham94
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants