-
Notifications
You must be signed in to change notification settings - Fork 490
Description
Context
We are trying to create documentation for a WIP protobuf-based API. All we are given are the .proto
files and a WIP C# demo client application where the C# proto code has already been generated.
I've successfully managed to use this application (protoc-gen-doc) to produce a readable and searchable HTML file. As well as a markdown tree.
But I am left with 1 single issue, the class members in C# are using CamelCase, whilst the proto files are using snake_case. So in the generated documentation, the members don't match what's used in code.
What I'm trying to do
For example, in C# code you'd have User.FirstName
, whilst in the doc it'll show as first_name
under User
I want the above doc to show FirstName
and LastName
. It looks this this functionality should have been added in #540
This is as much as I think I can show of the command that I currently use (and works to generate the doc with snake_case members):
protoc `
--doc_out=$PSScriptRoot/protoc-gen-doc `
--doc_opt="html,index.html" `
--proto_path="$PSScriptRoot/<redacted>/proto" `
$ProtoWildcards
(where $ProtoWildcards
is just a list of folders ending with /*.proto
because I couldn't get **
wildcards to work. Something like $PSScriptRoot/<redacted>/proto/some/paths/v1/*.proto
)
What I tried
I've tried the following with no change in output:
--doc_opt="html,index.html: :camel_case_fields=true"
--doc_opt="html,index.html:camel_case_fields=true"
--doc_opt="html,index.html:nothing_to_exlude:camel_case_fields=true"
The following just doesn't output any HTML:
--doc_opt="html,index.html::camel_case_fields=true"