the iml:
html
head
title "mypage"
body
a color="black" href="http://www.google.com" "google"
table
tr
td "test"
td
"another"
tr
td bgcolor="red" "second"
td
"and a nice
multiline
test"
that evaluates to:
<html>
<head>
<title>
mypage
</title>
<body>
<a color="black" href="http://www.google.com">
</a>
<table>
<tr>
<td>
test
</td>
<td>
another
</td>
</tr>
<tr>
<td bgcolor="red">
second
</td>
<td>
and a nice
multiline
test
</td>
</tr>
</table>
</body>
</head>
</html>
I think that's pretty nice :)
If you want, play around with the parser
2 comments:
You might be interested in looking at YAML (http://www.yaml.org/). Check out the "Get Started" link on there for an example.
Ben Sizer (came here via Ian Bicking's weblog)
I checked out yaml before I did this, three particular things disturbing about yaml.
-Yaml is not a markup language. Long story simple truth, markups can be converted against each other, not markups are either not safe or not sanely translated into markup.
-Yaml introduces some line-noise I did not want
-I do not want to set on a fixed indent-width ( as you may have noticed, the first line of a block in iml sets the correct indent for the rest of the blocks, quite like python.
In short thus, yaml or xml are not pythonic, iml is.
Post a Comment