[Top][All Lists]

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

Re: [help-texinfo] Changing background color of the 'verbatim' environme

From: Patrice Dumas
Subject: Re: [help-texinfo] Changing background color of the 'verbatim' environment
Date: Thu, 13 Sep 2012 15:08:54 +0200
User-agent: Mutt/1.5.20 (2009-12-10)

On Thu, Sep 13, 2012 at 10:40:31AM +0200, Thien-Thi Nguyen wrote:
> () address@hidden (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}
<div class="redbackground">
@end html
@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"
                "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 &quot;dark blue&quot;  fg &quot;fireengine red&quot;
                &quot;one, or \&quot;more\&quot; (depending)&quot;
             texi:id &quot;the first &arobase;example 

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.


reply via email to

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