tabatkins / railroad-diagrams

:steam_locomotive: A small JS+SVG library for drawing railroad syntax diagrams, like on JSON.org. Now with a Python port!
MIT License
1.66k stars 153 forks source link

Fix Issue 94 for Python #105

Closed RossPatterson closed 11 months ago

RossPatterson commented 11 months ago

This PR adds support to the Python port for generating text-mode diagrams as an alternative to SVG. The diagrams can be drawn with either pure-ASCII or Unicode (U+25xx) characters, or with any characters of the user's choosing. I have compared the SVG and text-mode output for all test.py test cases visually, and they all look correct to me.

If this PR is merged, I'll look into porting the final accepted code to the JavaScript version.

Feel free to comment on the code and recommend changes - nobody has seen it before but me :-)

Notes