Skip to content
kd
5 Jun 2020
Back to blog

Drawing in ASCII

1 min read (55 words)

We can define a lua filter for pandoc that takes a code block that has the language defined as render_svgbob, and passes the text inside that code block to svgbob.

Here is a simple 3-bus circuit diagram using text / ascii:

```svgbob
| +-----------+ |
+-----------+ +-----------+
| +-----------+ |
+-----+1 y12 2+------+
| | | |
| +-+ +-+ |
.-+-. | \ / | .-+-.
| | \ / | |
| |y1 .-+-. .-+-. y2| |
'-+-' \ \ y13 y23 / / '-+-'
| \ \ / / |
| '-+-' '-+-' |
------- \ / -------
--- + + ---
- | 3 | -
---+-------+-------+---
|
.-+-.
| |
| |y3
'-+-'
|
|
-------
-----
-
```

And with svgbob, it looks like this:

1 y12 2 y1 y2 y13 3 y3 y23

Citation

@online{krishnamurthy2020drawinginascii,
  author = {Dheepak Krishnamurthy},
  title = {Drawing in ASCII},
  year = {2020},
  date = {2020-06-05},
  url = {https://kdheepak.com/blog/drawing-in-ascii/},
  langid = {en},
}

For attribution, please cite this work as:

Dheepak Krishnamurthy, "Drawing in ASCII", June 5, 2020 https://kdheepak.com/blog/drawing-in-ascii/


The egg tower puzzle
Neovim + LanguageServer.jl