pseudomuto / protoc-gen-doc

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

Html bookmarks are incorrect for submessages #351

Open CptanPanic opened 6 years ago

CptanPanic commented 6 years ago

I am having problems whereas is if I have a submessage, so a protobuf message that contains field of another message, the html bookmark doesn't work correctly. For the attached example

syntax = "proto3";

message TestMessage{
   ArmType arm_type = 1;
}

message ArmType{
  bool hello = 1;
}

So in the generated html doc, the first link to ArmType is correct, <a href="#.ArmType">

but the second link is missing the '.' , <td><a href="#ArmType">ArmType</a></td>

Sorry I am a system whereas I can't install go compiler, etc so can't use from source.. So can only use prebuilt versions.

Attached is example proto and result html file. Note that if you click on ArmType link in description of TestMessage nothing happens because anchor is wrong, see line 242 of .html.

Downloads.zip

Generated with

protoc --plugin=/opt/protoc-gen-doc --doc_out=./doc --doc_opt=html,index.html test.proto

jlubawy commented 6 years ago

You can fix this in the short-term by adding a package com.example to your protobuf files, the problem happens when you don't specify one.

If you want to wait I tried fixing it here: https://github.com/pseudomuto/protokit/pull/3

MaggieLeber commented 5 years ago

Sure would be helpful to me if this were fixed...I can't control the protobuf source I'm documenting.

michalkaptur commented 9 months ago

Hi @jlubawy , was your PR closed just due to inactivity or are there some other reasons like offline discussion with the repository maintainer? The problem seem to be still present :worried:

jlubawy commented 9 months ago

I closed it trying to clean up old PRs that were never merged. Feel free to try and open a new PR, the code change is here https://github.com/jlubawy/protokit/commit/a81098c6b2ce862c17e36c23847c8b92e41cd913