ur-sundown: Ur/Web bindings to the Sundown library for Markdown
This library violates all the principles of type-safety found in
Ur/Web, as it effectively contains a function of type
xml, and you should be ashamed for using it. It only exists in all
its misfortune because I wanted to use it for my own blog code, so I
could write markdown-formatted posts (and you basically have to treat
a literal string as an XML fragment at some point, somewhere.)
If you're willing to be considered an awful person on some level by using this unholy piece of code, then please, read on and continue.
To install it, you need Python to run waf (I've used 2.7.1 and pypy 1.6 on Ubuntu Natty.) You also need the Ur/Web compiler installed.
If you have that, then install by saying:
sudo ./waf configure build install -p
If you installed Ur/Web to some other directory when you compiled it,
$HOME, you need to use the
./waf configure build install -p --prefix=$HOME
Otherwise it won't be able to find the Ur/Web C FFI #include files.
Afterwords, you can test it by doing:
$ cd t/ $ urweb testSundown $ ./testSundown.exe # browse to http://localhost:8080/
Ur/Web and Sundown are both pretty fast. But how fast? Using siege on
testSundown program, we get the following results. Note, the
testSundown HTTP server was started with 8 threads on my hyperthreaded, dual core
core i5 (4 logical CPUs,) and Siege was launched with 8 concurrent connections
over 5 minutes. The sundown library renders markdown to HTML for every page hit.
$ ./testSundown.exe -t 8
$ siege -b -c8 -t5m http://localhost:8080/
Availability: 100.00 % Elapsed time: 299.06 secs Data transferred: 1048.13 MB Response time: 0.00 secs Transaction rate: 12849.65 trans/sec Throughput: 3.50 MB/sec Concurrency: 5.47 Successful transactions: 3842818 Failed transactions: 0 Longest transaction: 0.03 Shortest transaction: 0.00
During this test,
testSundown.exe was consistently using ~520KiB of memory.