Is it possible to create aliases of protobuf's scalar types?
For example, I'd like to use Sequence
in lieu of string
, even though they would be binary equivalent.
My immediate goal is to make documentation (generated with protoc-gen-doc) more readily understandable.
Ideally, this type would be represented in languages that support type checking, but that's not necessary.
[Update: Aug 2017. Adapted to the full Go rewrite of protoc-gen-bug, currently
1.0.0-rc
]I don't have an answer for type aliases, but do have one for this:
And also I want to point out that
protoc-gen-doc
has been entirely rewritten in Go and now uses Docker for generation instead ofapt-get
.I have created some
html
andmarkdown
demo's of using inline rich formatting within your comments, like adding links, code snippets, tables, bold, italic, etc.And also describe how you can auto-generate and publish to Github Pages (
gh-pages
branch) using TravisCIThere are some small bugs that still need to be solved (Aug 2017) for it to be production-ready.
View the demo's + description at:
.
For example having markdown inlined comments like these:
.
Will result in output similar to this:
(Note: The hypercore protocol is one of the core specifications of the Dat Project ecosystem of modules for creating decentralized peer-to-peer application designs. I used their
.proto
file to demonstrate concepts)Well this will be a bit dull answer but:
No, I'm not aware of such feature existing or having been planned.
You can sort of emulate it by making submessages that contain only a single field, but that will alter the binary representation.
You're not the first asking this though: