bug-texinfo
[Top][All Lists]
Advanced

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

Re: Problematic indentation in HTML output of makeinfo


From: Thomas Keller
Subject: Re: Problematic indentation in HTML output of makeinfo
Date: Sun, 22 Nov 2009 19:47:52 +0100
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; de; rv:1.9.1.4pre) Gecko/20090915 Lightning/1.0pre Thunderbird/3.0b4

Am 22.11.09 16:28, schrieb Patrice Dumas:
> On Sun, Nov 22, 2009 at 12:46:35AM +0000, Karl Berry wrote:
>>     @smallexample
>>     This is
>>         a small
>>     example
>>     @end smallexample
>>
>> Patrice, can you check whether texi2html inserts the extra spaces in the
>> HTML output as makeinfo does?  It would be good to have the indentation
>> controllable in css.
> 
> In texi2html there is no extra space added, however the indentation is
> achieved through wrapping the <pre> in a table:
> 
> <table><tr><td>&nbsp;</td><td><pre class="smallexample">This is
>     a small
> example
> </pre></td></tr></table>
> 
> So this is not really possible to use css for the indentation. To drop the
> table, the simplest should be to do, in an init file (with the cvs 
> version, in the release, on has to use something along q{""}):
> 
> foreach my $complex_format (keys(%$complex_format_map))
> {
>    $complex_format_map->{$complex_format}->{'end'} = "";
>    $complex_format_map->{$complex_format}->{'begin'} = "";
> }
> 
> This may also modify how some parts of menus are formatted. To avoid that
> you could also do something along:
> 
> foreach my $complex_format (keys(%$complex_format_map))
> {
>    next if grep {$_ eq $complex_format} ('menu', 'detailmenu', 'direntry', 
> 'menu_comment');
>    $complex_format_map->{$complex_format}->{'end'} = "";
>    $complex_format_map->{$complex_format}->{'begin'} = "";
> }
> 
> 
> Should this be associated with a variable that may be set in an init file?

Hi Patrice!

Karl's question came up because I moaned about makeinfo producing HTML
output like this:

<pre class="smallexample">     This is
         a small
     example
</pre>

which is basically not styleable properly when CSS' `white-space`
property is set to `pre` or `pre-wrap` (the former is the default for
the <pre> element), because the leading whitespace cannot be removed /
controlled at all.

Apparently texi2html makes this better, though the indentation is
"emulated" as HTML table here, which could be hacked around, but is
still not optimal. Actually I think there is little to no reason to
render the indentation "hard" at all, CSS' `margin-left` and
`padding-left` properties should be enough for everyone adding the
correct padding afterwards. And the CSS box model already takes care of
proper indentation on different levels, because the margins of all outer
boxes add up.

Thomas.

-- 
GPG-Key 0x160D1092 | address@hidden | http://thomaskeller.biz
Please note that according to the EU law on data retention, information
on every electronic information exchange might be retained for a period
of six months or longer: http://www.vorratsdatenspeicherung.de/?lang=en

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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