bug-texinfo
[Top][All Lists]
Advanced

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

HTML and 'exdent' command (continued)


From: Mahlon
Subject: HTML and 'exdent' command (continued)
Date: Sun, 23 Nov 2014 20:47:49 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

Hi Pat,

The 'exdent' is difficult to style, but not impossible.

  • The @exdent would apply only inside @example and @display blocks because these blocks are preformatted AND indented. @exdent should be ignored everywhere else.

  • Note that currently, @exdent is also recognized inside @indentedblock and @quotation blocks; however, these are not preformatted, so the @exdent messes up the word-wrap algorithm.

  • Of course @exdent has no effect inside @format and @verbatim blocks because they are not indented.

  • Because I don't see it being used regularly by anyone even in the info output, it's probably not worth much time; however, the trick to get an HTML exdented line is:

1) define the 'example' class as having flush-left margins: margin-left: 0;

2) define 'example' <pre> as: margin-left: 3.2em;

3) define the exdented line only as outside of the <pre> i.e. as top-level 'example' text.

4) Even though the 'example' class itself is defined with 'white-space: pre', to make this work, we must continue to have a <pre> tag designed in CSS specifically for the 'example' and 'display' classes to differentiate between standard and exdented text.


Here is an @example block as generated by the converter:

<div class="example">

<pre class="example">unmodified line

</pre><pre class="example">exdented line

</pre><pre class="example">unmodified line

</pre></div>

And here is one that looks reasonably good after style definitions have been applied:

<div class="example">

<pre>unmodified line

</pre>exdented line

<pre>unmodified line

</pre></div>


Here is the CSS test definition for @example. @display would be similar, but not monospace.

.example

{

font-family: monospace;

font-size: inherit;

font-style: inherit;

font-weight: inherit;

color: inherit;

white-space: pre;

margin-left: 0;

}

.example pre

{

font-family: inherit;

font-size: inherit;

font-style: inherit;

font-weight: inherit;

color: inherit;

white-space: inherit;

margin-left: 3.2em;

}

There are certainly other ways to do it, and some of them would not generate the blank line before and after the exdented line, but this seems to be the easiest to implement in the converter. If you think it's worth some effort, I will continue experimenting with it.

Mahlon



On 11/23/2014 07:05 AM, Patrice Dumas wrote:
On Mon, Nov 17, 2014 at 10:26:07AM +0800, Mahlon wrote:
Hello all,

Yes, it can be done in CSS, and in fact I'm writing a reasonably
comprehensive CSS definition file that can be applied to the
texi-to-HTML output.

http://www.softwaresam.us/docs/docs.html
Ok.  If I understand well, you would like some integration of that in
makeinfo.  In any case, we can redistribute your css file in the contrib
directory.

The reason I bring it up is that the exdent looks bad any way I try
it.
But is there a way to make it look good?  Does it look good if in a
<span> and not a <pre>?  Or is it necessarily incorporated within a main
<pre> instead of having it split in 3?


--

Software Sam - software and tools for GNU/Linux

Mahlon Smith,
The Software Samurai
On the Web: http://www.SoftwareSam.us/


reply via email to

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