On Wed, Feb 20, 2008 at 10:07:16PM +0100, Pieter Verberne wrote:
Could it be an option (or; is it possible) to make a Troff macro wich -is- convertable to XML. Or in other words: Is it possible to create a Troff macro wich is 'syntactic sugar'/'alternative syntax' for XML?
Before I got swamped with this semester's workload, I was working on a project called thwack: http://crustytoothpaste.ath.cx/~bmc/code/thwack . It reads and processes troff input and is built on top of a SAX 2 framework, so that everything can be autoconverted to XML.
Included is a basic set of the -me macros that produces DocBook output, and you can create arbitrary XML with the "namespace", "start", and "end" requests. However, note that thwack is not complete; it may work for you, but it isn't yet bug-for-bug compatible with any version of troff. In fact, many of the presentational requests are not yet implemented (although I have plans) because at the moment, there is no framework for laying out text.
It requires Qt 4 for Unicode and XML support, and patches are gratefully accepted. Some things may not work, so you should expect to send patches or at least file bug reports.
I don't know if this is exactly what you are looking for, but it can probably be manipulated into doing what you want.
HTH. -- brian m. carlson / brian with sandals: Houston, Texas, US +1 713 440 7475 | http://crustytoothpaste.ath.cx/~bmc | My opinion only troff on top of XML: http://crustytoothpaste.ath.cx/~bmc/code/thwack OpenPGP: RSA v4 4096b 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
signature.asc
Description: Digital signature