groff
[Top][All Lists]
Advanced

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

Re: [Groff] Regarding HTML rendering


From: Ralph Corderoy
Subject: Re: [Groff] Regarding HTML rendering
Date: Thu, 17 Aug 2017 14:20:21 +0100

Hi Mikkel,

> As you can see, there is also a mistake with the colors. I would also
> like to receive suggestions for how this error can be eliminated in
> the HTML rendering.

Here's how I worked out what the problem was.

    $ printf '%s\n' \
    >     'rod\m[red]knight\m[]rod' \
    >     'rod\m[grey]matter\m[]rod' |
    > troff -Thtml
    ...
    H0
    md
    trod
    mr 65535 0 0
    tknight
    md
    trod
    wh24
    trodmatter
    mr 65535 0 0
    trod
    n40 0
    x trailer
    V23999760
    x stop
    $

The `65535 0 0' just before the `knight' is the RGB for red.  And I can
see an `md' after it before the black `rod' so that must reset it.  But
there's no colour change for `matter', it's just in the same `t' as its
preceding `rod'.  So `\m[grey]' isn't having an effect, and that
explains why the second `\m[]' is switching back to red, the previous
colour.

At this point, I turned on -wall.  :-)

    ...
    > troff -wall -Thtml >/dev/null
    <standard input>:2: warning: color `grey' not defined
    $

Sure enough,

    $ grep -r 'defcolor.*\<grey\>' /usr/share/groff
    /usr/share/groff/1.22.3/tmac/dvi.tmac:.defcolor grey rgb #bebebe
    /usr/share/groff/1.22.3/tmac/ps.tmac:.defcolor grey rgb #bebebe
    $

html.tmac has lots of colours, but not `grey'.  You can define your own
so you know they will exist for different output devices.

Looking at the output of `troff -Thtml' for you three-colour, LCR,
tabbed, header I see the `devtag' for the centre column, so it's odd why
its content appears in the right-hand <td> in the HTML.

-- 
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy



reply via email to

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