~ / blog / Drawing in ASCII

Fri, Jun 05, 2020

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

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

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

```render_svgbob
text here will be passed to svgbob
```

This is what it would look like when rendered on this blog:

1 y12 2 y1 y2 y13 3 y3 y23