Skip to content

arnehilmann/a2sketch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

547002e · Dec 14, 2020

History

54 Commits
Mar 20, 2019
Jul 26, 2020
Dec 10, 2018
Jul 26, 2020
Jan 16, 2019
Mar 21, 2018
Jan 17, 2019
Jan 17, 2019
Dec 13, 2020
Dec 8, 2018
Jan 21, 2019
Jan 21, 2019
Jul 26, 2020
Apr 24, 2018
Apr 24, 2018
Apr 24, 2018

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