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
[question]: text output? #94
Comments
I've thought about this before, too, and it's certainly possible, but it would involve essentially rewriting the entirety of the rendering functions. On the plus side, all the essential rendering logic has already been written once, so it should be relatively straightforward to translate over, but it's definitely a Task. If you're interested in trying it out, you probably want the nice box-drawing characters |
Well I'm playing with the idea of using kitty image protocol in terminals to render the SVG graphics. WDYT about a lua version of railroad-diagrams? That would ease integration with neovim (or any other lua host), regarding which I found this: https://gist.github.com/brimworks/1390733 |
I can't actively maintain a Lua version, so I'm not comfortable keeping such code in this repo, but I'm more than happy to link to a well-done port. |
FWIW, I built a railroad diagram text renderer for a mainframe-based tool ("B2H") about 20 years ago, in IBM's Rexx language. The tool took IBM's BookMaster GML markup as input, so the syntax is different from this package's, but the data model is almost identical. I have a need for text output myself, so I'm going to take a crack at re-writing my old work in Python as something like a set of |
I have an implementation of text rendering for everything except OptionalSequence(). I'll be away for a few weeks, but I'll do that one when I'm back. Other than that, it renders everything in My changes do not affect any existing code - they are 100% new routines and a single new class. Here are samples:
Feel free to comment on these results. I'll be back online in a couple of weeks, and I'll get back to finishing this work. |
Oh dang, that's neat! Having both renderers is nice - the box-drawing characters look real messed up given the fonts on my machine right now, but they look great in the console; the ASCII looks decent in both. |
It's actually just a single renderer, which takes a |
Forgot to say - this is in Python right now. If a PR is welcome for this work, I'll translate it to Javascript as well. |
Definitely welcome. I'd also be happy to do the port myself, if you're more comfortable with Python. But if you're fine with JS as well, go ahead. |
I've implemented the last of the diagram classes, and updated the test result files (see above). I'll start putting a PR together for the Python port. |
Hello!
I'm interested in the possibility of rendering railroad diagrams in text for use in neovim or other terminal-bound editors. Is that something that could be done with this library? Would it involve subclassing the various entities?
Cheers
The text was updated successfully, but these errors were encountered: