Skip to content

arnehilmann/a2sketch

Repository files navigation

a2sketch

convert asciiart to handwritten sketches

sketch

     #-------------------.
     |[0]                |
     | .---# .---# #---. |
     | |[1]| |[1]| |[2]| |
     | #---' #---' '---# |
     |   ^     ^     ^   |
     #---+-----+--=--+---#
     |   |     |     |   |
     |   a     2  sketch |
     '-------------------#
  github.com/arnehilmann/a2sketch

[0]: {"fill": "#933", "a2s:delref": true, "fillStyle": "solid"}
[1]: {"fill": "#bbb", "a2s:delref": true, "fillStyle": "solid"}
[2]: {"fill": "#bbb", "a2s:delref": true, "fillStyle": "solid", "a2s:type": "circle"}

tl;dr

docker pull arne/a2sketch:0.11
docker run -it -p 22357:22357 arne/a2sketch:0.11
curl -s --data-binary "-=-=- tadahh -==-" http://localhost:22753/a2sketch -o sketch.svg
open sketch.svg

documentation

see the original How Do I Draw Section of the old asciitosvg readme

local testing

To test your asciiart rendering and your custom shapes locally, you can use the following make targets:

  • start
    builds the image and starts the server

  • stop
    stops the server

  • test
    runs a small test against a running server, taking .a2s files from the examples folder

  • debug
    starts the container, but does not start the webserver automatically

your own shapes

In a2s-custom-types, you can define your own shapes:

  1. the filename must be the name of your shape with ".path" extension
    example: shape "drop" -> a2s-custom-types/drop.path

  2. the file must contain a single path element, with the attributes width, height, and d
    example: <path width="100" height="100" d="M 50 0 A 50 50 0 1 0 100 50 V 0 Z" />

Notes: review the Creating Special Objects Section and have a look at some svg path documentation, like the SVG Path Tutorial.

References

@docker-hub

Credits

License

MIT License © Arne Hilmann