[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [help-texinfo] html: playing with the style
From: |
Patrice Dumas |
Subject: |
Re: [help-texinfo] html: playing with the style |
Date: |
Fri, 26 Apr 2019 23:38:31 +0200 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Fri, Apr 26, 2019 at 05:54:34PM +0200, Akim Demaille wrote:
> Hi all,
>
> Bison has recently gained colored diagnostics, like GCC does. I would like
> to document that and show examples of this. I would like to do that in PDF,
> but I don't think it is possible, and probably not desirable. I would like
> to do it in HTML, but then I have a bunch of problems on how to do it.
For text within a paragraph, it is better to use inline conditionals,
like @inlineraw{html, <b style="color:\name\">\text\</b>}, so the whole
could be something like
@macro color{name, text}
@inlinefmtifelse{html, @inlineraw{html, <b style="color:\name\">\text\</b>},
\text\}
@end macro
>
> When I try something like this:
>
> @ifhtml
> @macro color{name, text}
> @html
> <b style="color:\name\">\text\</b>
> @end html
> @end macro
> @end ifhtml
>
> @ifnothtml
> @macro color{name, text}
> \text\
> @end macro
> @end ifnothtml
>
> @example
> $ @kbd{bison -Wmidrule-value mid.y}
> mid.y:2.6-13: @color{purple, warning}: unset value: $$
> 2 | exp: @color{purple, @{ a(); @}} "b" @{ $$ = c(); @} @{ d(); @} "e" @{
> f = $1; @};
> | @color{purple, ^~~~~~~~}
> @end group
> @end example
>
> it fails with an error:
>
> /Users/akim/src/gnu/bison/doc/bison.texi:4307: warning: @html should only
> appear at the beginning of a line (possibly involving @color)
> /Users/akim/src/gnu/bison/doc/bison.texi:4307: superfluous argument to @end
> html: : unset value: $$ (possibly involving @color)
> /Users/akim/src/gnu/bison/doc/bison.texi:4308: warning: @html should only
> appear at the beginning of a line (possibly involving @color)
> /Users/akim/src/gnu/bison/doc/bison.texi:4308: superfluous argument to @end
> html: "b" @{ $$ = c(); @} @{ d(); @} "e" @{ f = $1; @}; (possibly involving
> @color)
> /Users/akim/src/gnu/bison/doc/bison.texi:4309: warning: @html should only
> appear at the beginning of a line (possibly involving @color)
>
> If I add an empty lime
>
> @ifhtml
> @macro color{name, text}
> @html
> <b style="color:\name\">\text\</b>
> @end html
>
> @end macro
> @end ifhtml
>
> than the output is broken:
>
>
>
> I'm afraid that the image will be removed by the mailing list, so let me
> describe the result: the bold and the color are there, but the layout is as
> follows:
>
> > mid.y:2.6-13: warning
> >
> > : unset value: $$
> > 2 | exp:
> > { a(); }
> >
> > "b" { $$ = c(); } { d(); } "e" { f = $1; };
> > |
> > ^~~~~~~~
>
>
> instead of
>
> > mid.y:2.6-13: warning: unset value: $$
> > 2 | exp: { a(); } "b" { $$ = c(); } { d(); } "e" { f = $1; };
> > | ^~~~~~~~
>
> What can I do?
>
> Thanks!