diff --git a/svg-kparse b/svg-kparse new file mode 100755 index 0000000000000000000000000000000000000000..747ad10e1780c6ac6ef9643187c4927c71b77824 --- /dev/null +++ b/svg-kparse @@ -0,0 +1,5 @@ +#!/bin/sh +echo "Content-type: image/svg" +echo "" +k $@ | xargs echo +exit 0 diff --git a/svg.k b/svg.k new file mode 100644 index 0000000000000000000000000000000000000000..8e1581078d6a6044dd3e06a42c78fa8e238d8a00 --- /dev/null +++ b/svg.k @@ -0,0 +1,12 @@ +f:{,//$'x} /stringify and flatten +svgwrap:{f"",z,""} +svgon:{f ""} +svgoff:"" +strokec:"black" +strokew:3 +fill:"red" +c:{f""} +cc:{f""} +h:{$[x=0;,0;(,//(!10;"abcdef"))[16\x]]} +h2:{f$[(#h[x])=1;"0";""],$'h[x]} +rgb:{,//"#",h2'x} diff --git a/tests.k b/tests.k new file mode 100644 index 0000000000000000000000000000000000000000..f5ec840ac1641c98f43c06ea42ae9a35d13e4ea9 --- /dev/null +++ b/tests.k @@ -0,0 +1,16 @@ +\l svg.k +pow:{y(x*)/1} /positive exponentiation +strokec:"black" +strokew:3 +fill:"red" + +m1:(10 10 10;20 20 10;30 30 10) +m2:+(10*1+!10;20*1+!10;pow[1+!10;2]) +m3:|50*1++!5 5 5 +m4:+(64#500;64#500;|10*1+!64) +m4c:rgb'64*+!4 4 4 + +svgon[1000;1000] +strokew:0 +cc'[+|1_|+m4;(+m4)[2];m4c] +svgoff diff --git a/www-kparse b/www-kparse new file mode 100755 index 0000000000000000000000000000000000000000..eba68233475c6a53b2bd7ef192281f93b52d5c8f --- /dev/null +++ b/www-kparse @@ -0,0 +1,7 @@ +#!/bin/sh +echo "Content-type: text/html" +echo "" +echo "ksvg: Preview" +k $@ | xargs echo +echo "" +exit 0