-
Notifications
You must be signed in to change notification settings - Fork 46
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
generate docs #355
generate docs #355
Conversation
Also, because it's a protoc plugin - this is not a single file definition, but rather an html per proto def, same as our go definitions. I'm really not sure how useful that is. @webmaster128 can you please chip in? |
Codecov Report
@@ Coverage Diff @@
## master #355 +/- ##
========================================
+ Coverage 70% 70.3% +0.3%
========================================
Files 127 127
Lines 6269 6536 +267
========================================
+ Hits 4391 4600 +209
- Misses 1430 1462 +32
- Partials 448 474 +26
Continue to review full report at Codecov.
|
Yeah nice! Checking this in is good as well.
It gives us 80 % of the value with 20 % of the work. This is great stuff.
html is great
Merging all *.proto files into one document is key since users do not want to try to understand this project's folder structure before using it. The proto files should be merged more or less the same way they are merged in the js codec generation before the html file if generated:
|
@webmaster128 I'm not sure how
will complain Because of double imports. It seems to be tricky and I have yet to find a way for this to work. |
In contrast to the existing Makefile, you do not need to maintain a list of folders. But feel free to use any other method to collect all relevant .proto files. Looks like the system does not understand that
are the same file |
@webmaster128 I have come up with this solution:
But it outputs a pretty empty doc file. I'm not sure if this is worth fighting for to be honest, I'll invest a bit more time though. |
I wonder why this does not happen when we build the .js files from the protos in IOV-Core: https://github.com/iov-one/iov-core/blob/master/packages/iov-bns/package.json#L31 |
@webmaster128 golang pb generator seems to work differently. |
Couln't re remove all import statements that start with Here is a find and patch script for .proto files https://github.com/iov-one/iov-core/blob/master/packages/iov-bns/scripts/cleaned_protos.sh that could be adjusted |
@webmaster128 yeah we could, I'm just not sure that adjusting the files and then generating a doc from this is the best way to approach it, because then the paths don't correspond to whatever is in the app. Should we define a proper definition of done here first? |
I will take a look at this today, see if I can combine them somehow. We need the full paths in the protobuf files for the golang compiler, as it will use that as the import path in I've fought protoc a bit with imports before, I think I might be able to shake this out in within an hour. If not, I would propose multiple html files and do post-processing. |
@ethanfrey take a look at my solution here #355 (comment) , it kind of works, but generates an empty doc (only base types) and also throws and error |
Okay, I ran
The output looks nice, but my first reaction (besides many small files) is that the links are broken, for example I will try to see what I can build |
Okay, simple case of getting x.Coin and cash.FeeInfo, cash.SendMsg all in one doc...
Of course, I had to edit x/cash/codec.proto first to change the import: But then,
|
I think inspiration can be taken from https://github.com/iov-one/iov-core/blob/master/packages/iov-bns/scripts/cleaned_protos.sh |
I had to clean up the Anyway, now always run from vendor for more reproduceable build |
@webmaster128 Now built in a single-file, hopefully this is what you were looking for. Let me know if this is better. |
634f2ad
to
c4517a0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it now, after adding some scripts for the single-file protobuf files.
@ethanfrey yeah, it might have actually been an executable problem, glad that this is cleaned up now. looks good to me |
Beautiful 😍 😍 😍 |
Work on #187
@ethanfrey I have generared sample docs in html. This plugin does not seem to support RST, so we can probably choose between
.md
and.html
.It looks like the easiest way is to generate docs with go proto defs and commit as a developer.
But I think this is not very usable at the moment and it'd be nicer to have a template there too.