Forum Samples, Tips and Tricks

FopSnor, a less verbose alternative to XHTML

Inopia
Hellos,

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 :)
Inopia
A description of the syntax and a compiled jar file can be found here:

http://www.assembla.com/wiki/show/fopsnor

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.

Cheers,

Niels
mikeday
Neat! The @ symbols seem more reminiscent of Lout syntax than LaTeX, though. :)
Inopia
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:

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

would be

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

in FopSnor.
mikeday
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.
Kelsin
A lot of people use LISP syntax and sexp-expression to html parsers as well.