PipeDent: a port of a small subset of shpaml to coffeescript

8 views
Skip to first unread message

Steve Howell

unread,
Jul 3, 2011, 5:22:41 PM7/3/11
to shp...@googlegroups.com
Fans of Python and Shpaml may have the "coffeescript" language on their radar.
I've been doing some small projects in CS, and it's a fun language to work in.
I decided today to port a small subset of shpaml to coffeescript.

Here is the project:

https://github.com/showell/PipeDent/blob/master/pipedent.coffee

I'm calling it PipeDent for now, because I am just porting a minimal subset of
features for now.

You can see it here. Right now I just support it in node.js, but obviously it
would be nice to make it work in the browser too.

~/WORKSPACE/PipeDent > coffee -c *.coffee && cat test.coffee && echo '----' &&
node test.js
input = \
'''
html
head
body
table
tr
td id="one" | one
td id="two" | two
p
| This is just free
| form text.
div class="body"
<b>raw html just passes thru and takes precedence over | </b>
span | Hello world
'''

pipedent = require './pipedent'
console.log pipedent.convert(input)


----
<html>
head
<body>
<table>
<tr>
<td id="one">one</td>
<td id="two">two</td>
</tr>
</table>
<p>
This is just free
form text.
</p>
<div class="body">
<b>raw html just passes thru and takes precedence over | </b>
</div>
<span>Hello world</span>
</body>
</html>

Steve Howell

unread,
Jul 4, 2011, 2:23:12 PM7/4/11
to shp...@googlegroups.com
Just to follow up, the PipeDent library can now be used from within a browser.
Coffeescript makes it far more convenient to create client-side HTML than
Javascript, because it supports multi-line strings.

I set up a mailing list here:

http://groups.google.com/group/pipedent

Reply all
Reply to author
Forward
0 new messages