Forum Samples, Tips and Tricks

FopSnor, a less verbose alternative to XHTML


I'm writing my master thesis, and looking for an alternative to latex I stumbled across Prince. I really like it, but I'm not so happy with the verbosity of the XHTML syntax.

So as any good nerd should, I wrote a quick and dirty parser that's based on curly braces instead of <tag></tag> and can automatically generate paragraphs. You simply write some text in this format, convert it with a FopSnor and out comes valid XML.

I've found it useful myself, so I thought some people on this board might like it too. It's probably buggy since I didn't test corner cases much, but who knows, it just might work for you.

I'm not going to break up this post and continue in a second one since I'm not allowed to post a link in my first post :)
A description of the syntax and a compiled jar file can be found here:

If you don't know how to run a Java .jar file:

java -jar fopsnor.jar input.fs -o output.xml

Since it's Java and doesn't use anything weird it should run on Linux (tested on Intrepid, JDK6), OSX and Windows. Let me know how that works out.


Neat! The @ symbols seem more reminiscent of Lout syntax than LaTeX, though. :)
The difference is that lout will let you do

text @bla more text

whereas in FopSnor you always need curly's:

text @bla{} more text

Also lout specifies attributes in a different way. The following in lout:

margin { 0.5c }
paint { lightgrey }
{ Hello world }

would be

@CurveBox(margin="0.5c" paint="lightgrey"){ Hello world }

in FopSnor.
Both are acceptable syntaxes for people with an aversion to end-tags. :)
carl johnson
I just write my text in Markdown and then turn that into XHTML. It's pretty simple.
A lot of people use LISP syntax and sexp-expression to html parsers as well.