This is pretty nice if you have an editor with block mode (like vim) and you are faster with a keyboard than a mouse (most programmers). It integrates well with text based version control and degrades gracefully in that users who don't have the tools and are just looking at the source can probably still read it, and even edit it.<p>I tried using this for the control flow diagrams in V8's regexp implementation, which are documented with ASCII art in jsregexp.cc
Results are here: <a href="https://twitter.com/erikcorry/status/1548954799290421249" rel="nofollow">https://twitter.com/erikcorry/status/1548954799290421249</a><p>This link explains it better than the page HN links to: <a href="https://code.sgo.to/2022/06/20/typographic-diagrams.html" rel="nofollow">https://code.sgo.to/2022/06/20/typographic-diagrams.html</a><p>It would be an improvement for the page that HN links to if the HTML snippet was surrounded by <body></body> so it worked out of the box.<p>Tips:<p>Don't use underscores for horisontal lines - use dashes (minus signs).<p>A vertical arrow that points at a text will collide with the text unless you add a blank line.<p>Rounded corners are nice. You get these by using . (period) or ' (single quote) instead of + (plus) to join lines. Use period to join to a vertical line below the horizontal line, and single quote to join to a vertical line above the horizontal line.
Could have something a little more usable if you pasted into a tool like <a href="https://asciiflow.com/" rel="nofollow">https://asciiflow.com/</a> and then copied your edits back into source.<p>Or an editor plugin with something like the automatic table formatting you get with emacs org-mode.
In the section on Line Ends, <a href="https://code.sgo.to/typograms/" rel="nofollow">https://code.sgo.to/typograms/</a> shows a box surrounded by arrows and a dot surrounded by arrows.<p>The arrows that point down (down and left, down, and down and right) are rendering the arrow heads as ascii V's.<p>That seems different than elsewhere on the page.<p><pre><code> \ | /
\ vvv / \ | /
v+-----+v vvv
->| |<- ->*<-
^+-----+^ ^^^
/ ^^^ \ / | \
/ | \</code></pre>
I find ASCII diagrams to be the opposite of Markdown. Markdown isn't perfect and so that is where extensions come into play, but ASCII diagrams are more like man pages. I think ideally a diagram markup software would use YAML or some other similar convention to show hierarchy while still be readable. Typing and editing ASCII diagrams by hand is simply not convenient.
The problem with ascii diagrams is that it is difficult to edit. Say you want to move that resistor in the circuit shown in the article. You could use something like Monodraw to combat that, but then I just end up using good ol' power point. There are only handful of instances when ascii diagrams are useful, may be like an IETF proposal.
FWIW, I explained a bit why/how I've been using it here: <a href="https://twitter.com/samuelgoto/status/1548845628171722752" rel="nofollow">https://twitter.com/samuelgoto/status/1548845628171722752</a>
I couldn't get the demo to work without wrapping head and body tags around the appropriate sections. But once I got past that hurdle, it was easy to get some pretty nice pictures drawn. Thanks for the program!
This is very slick!
Regard to editability of text diagram, brainstorming here: it would be cool to have two-way convertibility between text diagram and svg diagram. so users can use drag and drop like interaction to edit the svg diagram, and convert back to text diagram, so it has the best of both worlds.
I guess roughly this idea already exists — there is program that converts image to ascii, but it lacks precision, as in the ascii to svg and then back to ascii would yield to different set from the starting point.
Not on the list of related work is "GoAT" (Go ASCII Tool):<p><a href="https://github.com/blampe/goat" rel="nofollow">https://github.com/blampe/goat</a>
I like this, but - in what contexts will typograms be accepted and rendered?<p>For example, email clients (e.g. Thunderbird) have not even bothered to let us use markdown for email. flowed-format text is about the most you can get out of them for now.