Open willchang opened 2 years ago
Is this feature available on latest
Thank you for your work on this library.
Is this feature available on latest
Thank you for your work on this library.
Thanks @adlion, it needs to be approved first by someone with write access. cc: @pseudomuto
Hello! I've come across a use case where it would be nice to have one output file per input file. I'm setting up a static documentation site for Proto files and the UX is better when the output mirrors the input instead of having them grouped together on one page (regardless of using
source_relative
or not).Summary
This PR adds support for a
separate_files
flag which outputs one file per input file instead of grouping input files into one output file.Usage:
This would output:
Notes on Behaviour
md
like in the example above, the output files would be<filename>.md
.source_relative
or without, it does not changesource_relative
's functionality.Testing it Out
I was testing using this command from the repo root:
Additional Notes on Implementation
I've kept the same convention of adding another parameter to the
--doc_opt
list. I can foresee this becoming hard to manage in the future since a) parameters are mapped to indices which makes the code ugly as you gain more parameters and b) usage-wise you must specifydefault
for previous parameters you may not care about. However, I didn't want to make assumptions on the grander vision of this API (and also introduce a lot of out-of-scope changes) so I just followed the convention.I'm an iOS developer and Go is a little foreign to me, so please feel free to give feedback on conventions or anything else that doesn't seem to fit quite right. Thanks!