Closed bannmann closed 1 year ago
Here's my proposal for a Java API for railroad diagram generation. So why should RR have one? Personally, I plan to use it to create a Maven plugin for RR, but I imagine that having a Java API could make RR useful for a wide variety of other applications
I'm also interested to integrate this library in https://kroki.io/ @GuntherRademacher I would suggest to add additional maintainers to help you move this project forward. Maybe @bannmann would be interested? What do you think?
Thanks for sending this PR. I have no objections. Sorry for the delay.
Here's my proposal for a Java API for railroad diagram generation. So why should RR have one? Personally, I plan to use it to create a Maven plugin for RR, but I imagine that having a Java API could make RR useful for a wide variety of other applications.
Notes
master
.RailroadGenerator
class uses the same default settings as the CLI.RailroadGenerator
class is free of CLI-specific assumptions and defaults:java.awt.Color
values instead of a hex strings.Railroad
.System.out
even inRailroadGenerator
, not only set by the CLI. The reason is that I'm not yet sure how the API for specifying outputs should look like.Caveats
RailroadGenerator
class are not implemented in that class, but in the XQuery files. This leads to some ambiguities regardingnull
. However, I think those are not really relevant.usage()
does not list thepadding
andstrokewidth
CLI options. I didn't change that as doing so is arguably not within the scope of this PR. Also, the omission may have been intentional.Looking forward to reading your opinion on this! I hope you find this work acceptable - if not, please just tell me what to change.