1

I have been given a challenge for my first week at work as a graduate and I am stumped already, The company I work for uses google protobuf files - Grpc and I know extremely little about protobuf - Grpc.

My tasks is: We are using doxygen to generate HTML documentation from source code. Want something similar for .proto files.

This is getting me down, I can not find anything yet that works out the box for a windows PC and works with protobuf files and outputs as HTML.

I have installed Doxygen but it does not support protobuf files is there a plugin or any other work around please?

Edit: I have installed proto2cpp and I have created a config file and edited as the wiki says too, but I am getting an error when trying to run it, something about python?

C:\Users\emartin>doxygen
Adding custom extension mapping: .proto will be treated as language c
Searching for include files...
Searching for example files...
Searching for images...
Searching for dot files...
Searching for msc files...
Searching for dia files...
Searching for files to exclude
Searching INPUT for files to process...
Searching for files in directory C:/Users/emartin/Desktop/test_proto_files
Reading and parsing tag files
Parsing files
Preprocessing C:/Users/emartin/Desktop/test_proto_files/test.proto...
'python' is not recognized as an internal or external command,  <------ is this the issue?
operable program or batch file.
Parsing file C:/Users/emartin/Desktop/test_proto_files/test.proto...
Building group list...
Building directory list...
Building namespace list...
Building file list...
Building class list...
Associating documentation with classes...
Computing nesting relations for classes...
Building example list...
Searching for enumerations...
Searching for documented typedefs...
Searching for members imported via using declarations...
Searching for included using directives...
Searching for documented variables...
Building interface member list...
Building member list...
Searching for friends...
Searching for documented defines...
Computing class inheritance relations...
Computing class usage relations...
Flushing cached template relations that have become invalid...
Computing class relations...
Add enum values to enums...
Searching for member function documentation...
Creating members for template instances...
Building page list...
Search for main page...
Computing page relations...
Determining the scope of groups...
Sorting lists...
Freeing entry tree
Determining which enums are documented
Computing member relations...
Building full member lists recursively...
Adding members to member groups.
Computing member references...
Inheriting documentation...
Generating disk names...
Adding source references...
Adding xrefitems...
Sorting member lists...
Computing dependencies between directories...
Generating citations page...
Counting data structures...
Resolving user defined references...
Finding anchors and sections in the documentation...
Transferring function references...
Combining using relations...
Adding members to index pages...
Generating style sheet...
Generating search indices...
Generating example documentation...
Generating file sources...
Generating file documentation...
Generating page documentation...
Generating group documentation...
Generating class documentation...
Generating namespace index...
Generating graph info page...
Generating directory documentation...
Generating index page...
Generating page index...
Generating module index...
Generating namespace index...
Generating namespace member index...
Generating annotated compound index...
Generating alphabetical compound index...
Generating hierarchical class index...
Generating member index...
Generating file index...
Generating file member index...
Generating example index...
finalizing index lists...
writing tag file...
lookup cache used 0/65536 hits=0 misses=0
finished...
  • How do the .proto files look like? Which version of doxygen are you using. Have you looked at the EXTENSION_MAPPING, FILTER_PATTERNS configuration settings? – albert Jul 2 at 11:59
  • Hello i am making good progress i have it almost running i am just unsure where to place the proto2cpp.py file?? – Edwin Martin Jul 2 at 12:27
  • Good that you have it almost running, but what have you done. Your comment is vague and it does not show what you have done. – albert Jul 2 at 12:36
  • Sorry i have followed the wiki page and created a config file and the other following steps as seen at sourceforge.net/p/proto2cpp/wiki/Home I can use the config with cmd and it shows the adjustments however it is not working as intended. I think i need to do something with the proto2cpp.py file as for now it is just sat on my desktop ?? do i need to point the proto2cpp.py to somewhere ? is this correct: INPUT_FILTER = "python C:\Users\emartin\Desktop\proto2cpp.py" – Edwin Martin Jul 2 at 12:42
  • Just try doxygen -d extcmd and see if the command you get looks OK, – albert Jul 2 at 12:52
1

proto2cpp link

Proto2cpp is a great tool which works with the existing Doxygen tool " my work uses version 1.8.15" with very little setup. You need to have Python installed and make sure python is recognized in CMD on it's own, if you get 'python' is not recognized as an internal or external command, then you need to add the path to the Python root folder in environment paths, i am using windows 10 so it was in

C:\Users\myName\AppData\Local\Programs\Python\Python37 

but if you are using windows 7 it will be elsewhere just search for the PythonXX folder where XX is the first 2 version numbers with no spaces or points.

Once you have python installed, then follow the proto2cpp wiki steps to make the config file "or download the example in the code tab" and then download the proto2cpp.py file in the code tab within there web page. You can then run a test using the test proto script and cmd using the command

doxygen C:\Users\myName\doxyfile    <-- or where ever you have your config file you created i named mine doxyfile.
  • Please specify the doxygen version you used. – albert Jul 2 at 14:32
  • Have also a look at: github.com/4hopp/proto2cpp here are some additional fixes and other proposed patches. – albert Jul 2 at 14:34
  • My work has it already installed and i am not allowed to just update Doxygen but to answer your question i am using Doxygen 1.8.15 – Edwin Martin Jul 2 at 15:28
  • 1.8.15 is currently the latest release, – albert Jul 2 at 16:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.