On Thu, Sep 13, 2012 at 10:40:31AM +0200, Thien-Thi Nguyen wrote: > () k...@freefriends.org (Karl Berry) > () Wed, 12 Sep 2012 22:01:34 GMT > > Another approach is to define a syntax to associate key/value pairs w/ > any particular environment. This could map to ‘class’ attributes for > HTML output, and would anyway be available to the (S)XML output for > further processing. Something like:
This is already possible to do something similar with what you propose by using raw formatting. Something like @macro redbackground{something} @html <div class="redbackground"> @end html \something\ @html </div> @end html @end macro and supply the correct CSS information through one of the way to provide css information. But this only works if the format handles some customization which doesn't seems to be the case for TeX. > @example (bg "dark blue" fg "fireengine red" > phase-of-the-moon > "one, or \"more\" (depending)" > texi:id "the first @example example") > ... > @end example > > @verbatim (texi:inherit "the first @example example") > ... > @end verbatim > > IOW, keys are symbols, values are strings, elements are separated by > whitespace, and the lot is enclosed in parentheses -- classic "plist". > Info output can simply ignore that noise (or not). Some of the keys > could be reserved for special handling, such as those whose names begin > with "texi:". That looks like a new layer above Texinfo which doesn't look like Texinfo at all. I think that this should better be put in raw formatting. If this is for processor of format foo, it is possible to add anything with (but notice that @ has to be escaped) @inlieraw{foo, bg "dark blue" fg "fireengine red" phase-of-the-moon "one, or \"more\" (depending)" texi:id "the first @@example example"} > Yeah, i know this is getting ugly real fast, but figure (sometimes) some > beauty can be achieved by confining ugly and ignoring it. Those inlineraw constructs will be in the internal tree, but will be ignored by all formatters except for a formatter that explicitly handles this format (or pseudo format) and it will appear in the Texinfo XML as: <inlineraw><inlinerawformat>foo</inlinerawformat><inlinerawcontent spaces=" ">bg "dark blue" fg "fireengine red" phase-of-the-moon "one, or \"more\" (depending)" texi:id "the first &arobase;example example"</inlinerawcontent></inlineraw> I don't think we need to add more specific things to the language (we already have enough inconsistencies with menus, @def*, @macro....). Now if we have some argument we think are usefull for a whole class of output, we can add it to @example. For example, we could have @example C, red some C code @end example with C the language of the example and red the background. But I am not sure we need that. -- Pat