groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Troff to XML


From: Meg McRoberts
Subject: Re: [Groff] Troff to XML
Date: Wed, 20 Feb 2008 13:59:18 -0800 (PST)

A general answer -- sort of ;-)

I was involved in some trial projects converting *roff
text to sgml and xml.  Automated scripts did a fairly
decent job with some exceptions, like tables.

We had to make some arbitrary decisions.  For example,
in *roff, we marked text as bold, italic, etc, but in the *ml,
we marked things as commands, files, functions, structures,
etc.  We had used bold for command and functions, so in
converting man(1) pages, we converted all bold strings to
commands, and for man(2) and man(3), we converted all
bold strings to function calls.

The other big issue we ran into was that, in *roff, you start
a section but in the *ml languages, you mark the beginning
and end of a section.  And I believe you had to respect the
hierarchy -- could not put an H4 directly into an H1, which
people did all the time in *roff documents as a short cut
to get a bit of emphasis on some text without making it
full-blown big sections that showed up in the TOC.

The automated scripts did a pretty good job but a fair amount
of manual manipulation was required to finish the job.

meg


--- On Wed, 2/20/08, Pieter Verberne <address@hidden> wrote:

> From: Pieter Verberne <address@hidden>
> Subject: [Groff] Troff to XML
> To: address@hidden
> Date: Wednesday, February 20, 2008, 1:07 PM
> Hi list,
> 
> Last days I've been thinking about if Troff (&
> Tex/LaTeX) could be
> converted to XML without losing any information. Much like
> SweetXML(1)
> is for XML:
> 
>  SweetXML is an alternate syntax for XML, designed to make
> configuration
>  files more concise and readable by adding a bit of
> syntactic sugar. It
>  changes XML's syntax without changing its fundamental
> structure, so
>  that it can work as a replacement for XML wherever
> readability is an
>  issue.
> 
> Ofcourse Troff is presentational markup, but it's
> macro's are (more)
> structural. (just forget about the presentational markup
> options in
> macro's for now) 
> 
> So I'm not sure, but I think 'fundamental
> structure' of the Troff
> macro's should be the same of XML. Or is this not
> required? Is it
> possible to convert Troff macro's to XML (and back) in
> a 'exact' way. (I
> just don't know the best words to say this in English
> but I think I'm
> clear.)
> 
> 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?
> 
> I think Troff is nice, cute.. It feels nice:-) But I also
> like strict
> structural markup languages.
> 
> I'm actually asking myself the exact same question
> about LaTeX, so sorry
> for being off-topic, but responses about LaTeX are welcome
> to.
> 
> (No, I've not done all my homework yet, but sometimes I
> have no patience
>  to study a lot before my questions got answered.)
> 
> (1) http://innig.net/software/sweetxml/
> 
> Pieter Verberne




reply via email to

[Prev in Thread] Current Thread [Next in Thread]