TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Typograms, Markdown-like renderer for ASCII diagrams

140 pointsby sgotoalmost 3 years ago

14 comments

ErikCorryalmost 3 years ago
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&#x27;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&#x27;s regexp implementation, which are documented with ASCII art in jsregexp.cc Results are here: <a href="https:&#x2F;&#x2F;twitter.com&#x2F;erikcorry&#x2F;status&#x2F;1548954799290421249" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;erikcorry&#x2F;status&#x2F;1548954799290421249</a><p>This link explains it better than the page HN links to: <a href="https:&#x2F;&#x2F;code.sgo.to&#x2F;2022&#x2F;06&#x2F;20&#x2F;typographic-diagrams.html" rel="nofollow">https:&#x2F;&#x2F;code.sgo.to&#x2F;2022&#x2F;06&#x2F;20&#x2F;typographic-diagrams.html</a><p>It would be an improvement for the page that HN links to if the HTML snippet was surrounded by &lt;body&gt;&lt;&#x2F;body&gt; so it worked out of the box.<p>Tips:<p>Don&#x27;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 &#x27; (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.
jcpstalmost 3 years ago
Could have something a little more usable if you pasted into a tool like <a href="https:&#x2F;&#x2F;asciiflow.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;asciiflow.com&#x2F;</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.
ThinkBeatalmost 3 years ago
I wish each example would also show the source. The site renders a bit strange on my browser right now so perhaps I have just missed it.
评论 #32137289 未加载
taitalmost 3 years ago
In the section on Line Ends, <a href="https:&#x2F;&#x2F;code.sgo.to&#x2F;typograms&#x2F;" rel="nofollow">https:&#x2F;&#x2F;code.sgo.to&#x2F;typograms&#x2F;</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&#x27;s.<p>That seems different than elsewhere on the page.<p><pre><code> \ | &#x2F; \ vvv &#x2F; \ | &#x2F; v+-----+v vvv -&gt;| |&lt;- -&gt;*&lt;- ^+-----+^ ^^^ &#x2F; ^^^ \ &#x2F; | \ &#x2F; | \</code></pre>
评论 #32138575 未加载
encryptluks2almost 3 years ago
I find ASCII diagrams to be the opposite of Markdown. Markdown isn&#x27;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.
评论 #32135145 未加载
评论 #32134649 未加载
systemvoltagealmost 3 years ago
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&#x27; power point. There are only handful of instances when ascii diagrams are useful, may be like an IETF proposal.
评论 #32134543 未加载
评论 #32134565 未加载
sgotoalmost 3 years ago
FWIW, I explained a bit why&#x2F;how I&#x27;ve been using it here: <a href="https:&#x2F;&#x2F;twitter.com&#x2F;samuelgoto&#x2F;status&#x2F;1548845628171722752" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;samuelgoto&#x2F;status&#x2F;1548845628171722752</a>
AstroJetsonalmost 3 years ago
I couldn&#x27;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!
评论 #32137694 未加载
wentinalmost 3 years ago
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.
everybodyknowsalmost 3 years ago
Not on the list of related work is &quot;GoAT&quot; (Go ASCII Tool):<p><a href="https:&#x2F;&#x2F;github.com&#x2F;blampe&#x2F;goat" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;blampe&#x2F;goat</a>
评论 #32134771 未加载
einpoklumalmost 3 years ago
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.
voz_almost 3 years ago
There&#x27;s soooo many things like this on HN - why is it better than <i>drawing</i> the picture in something like google docs or lucid chart?
评论 #32135172 未加载
评论 #32139748 未加载
评论 #32134404 未加载
评论 #32135402 未加载
ofoualmost 3 years ago
AWESOME
nathiasalmost 3 years ago
very cool