[xml2rfc] feature proposal: marking up Code Components

julian.reschke at gmx.de (Julian Reschke) Thu, 24 September 2009 13:44 UTC

From: "julian.reschke at gmx.de"
Date: Thu, 24 Sep 2009 15:44:56 +0200
Subject: [xml2rfc] feature proposal: marking up Code Components
Message-ID: <4ABB77D8.2040508@gmx.de>

Hi,

the new TLP suggest to markup code components in languages other than 
the common ones using

<CODE BEGINS>
...
<CODE ENDS>

See <http://trustee.ietf.org/docs/IETF-Trust-License-Policy.pdf>, 
Section 4b.

Of course that can already be done in xml2rfc by just adding these lines 
into the source, such as the artwork element, which usually contains the 
code.

But that has at least two drawbacks:

- it will display just as the code, even though in HTML it would be nice 
to distinguish it, and, even worse

- the contents of the artwork element doesn't conform to the declared 
media type anymore (using the @type attribute).

So, experimentally, in rfc2629.xslt I have added support for declaring 
that the contents of the artwork element should be decorated with these 
two lines.

Example source:

-- snip --
<figure><artwork type="code" x:isCodeComponent="yes">
int main(int argc, char **argv) {
   return -1;
}
</artwork></figure>
-- snip --


Generated HTML: 
<http://greenbytes.de/tech/webdav/rfc2629xslt/testcase.html#code.components>

Feedback appreciated,

Julian