Skip to content

Instantly share code, notes, and snippets.

@hbbio
Created August 12, 2012 00:29
Show Gist options
  • Save hbbio/3328124 to your computer and use it in GitHub Desktop.
Save hbbio/3328124 to your computer and use it in GitHub Desktop.
import stdlib.io.file
function svg_test(id, w, h, stroke) {
<svg:svg
svg:version="1.1"
id="{id}_svg">
<svg:rect id="{id}_node"
width="{w}" height="{h}"
x="{stroke/2}" y="{stroke/2}"
stroke="black" fill="white"
stroke-width="{stroke}">
</svg:rect>
</svg:svg>
}
function page() {
<h1>Resources:</h1>
<>{ binary = File.content("./res/test.svg");
Binary.get_string(binary, 0, Binary.length(binary) - 1);
}</>
}
Server.start(
Server.http,
{title:"mypage", ~page}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment