[html exporter for tests Olivier Schwander **20101027111833 Ignore-this: 111179ae9ee2b9195066e467a160e37b ] hunk ./org.py 3 +def chomp(x): + return x.rstrip('\n') + +def html(org, acc = None): + if org.level() == 0: + title = org.title() + print "\n" + print "%s\n" % title + print "\n" + print "

%s

\n" % title + print "
\n" + print org.body() + counter = 0 + for h in org._headings: + counter += 1 + html(h, [str(counter)]) + print "
\n" + print "\n" + print "\n" + else: + tags = "" + if org._tags is not None: + tags = " :" + ":".join(org.tags()) + ":" + print "
\n" % "-".join(acc) + print "%s%s%s\n" % (org._level, ".".join(acc) + " ", org.title(), tags, org._level) + print "
\n" + print org.body() + print "
\n" + counter = 0 + for h in org._headings: + counter += 1 + html(h, acc + [str(counter)]) + print "
\n" + hunk ./org.py 239 - print o + html(o)