discuss: linuxdoc text backend


Previous by date: 15 Oct 2005 08:23:33 -0000 Re: linuxdoc text backend, Stein Gjoen
Next by date: 15 Oct 2005 08:23:33 -0000 Re: linuxdoc text backend, David Lawyer
Previous in thread: 15 Oct 2005 08:23:33 -0000 Re: linuxdoc text backend, Stein Gjoen
Next in thread: 15 Oct 2005 08:23:33 -0000 Re: linuxdoc text backend, David Lawyer

Subject: Re: [discuss] linuxdoc text backend
From: David Lawyer ####@####.####
Date: 15 Oct 2005 08:23:33 -0000
Message-Id: <20051015082347.GA1455@lafn.org>

On Thu, Oct 13, 2005 at 05:22:37PM -0700, steven aatkinson wrote:
> 
> Hi,
> 
> I'm curious about the state of the script generated text documents,
> which have embedded special characters. The documents only seem
> to render properly using "more" and "less -r". Web browsers and most
> text viewers present the special chacters in an ugly fashion.
> Afaik the "sgml2txt"/"linuxdoc -B text" command doesn't have an
> option that correctly removes these special characters and I had to
> make a sed script to do

These are not "special characters".  sgml2txt seems to append escape
sequences to highlight (emphasize) title words.  If I "cat" a file to
my dumb terminal titles appear brighter.  It looks nice and likely works
on a linux terminal (monitor).  But if you read the text file  with
vim or text viewers (pagers), they convert the escape character into
^[ (two bytes) and send that to the terminal instead of a real escape
character.  So you see for example: ^[[1m before a title that should
be emphasized (in reverse video for example).

Should plain text contain escape sequences for display?  With these
sequences, certain words can display in color, etc.  It might look
like html and perhaps the pager could let you click on urls and follow
links on the Internet.  

Linuxdoc didn't have this bug in earlier versions so it's something
that happened in the past 5 years or so.  LDP text docs seem to be OK.
Don't know if LDP uses a sed script or an earlier version of Linuxdoc.

Linuxdoc is in Perl, which I don't know, but I've seemingly
fixed the problem.  What was happening was that linuxdoc uses the old
Unix text formatting system groff/troff (for text output).  The text
is intended to display on a terminal, and by default, the escape
sequences are added by the post-processor grotty.  So just use the
option in grotty to disable adding the esc sequences.  But since groff
calls grotty, how to pass this grotty option to groff?  How to do it
is supposed to be described in an info doc, but the contents are missing
on how to do this (You jump to a section and there's no text there.)
I checked with Google: same result.  So I found out the option to
disable esc seqences in nroff which is something like groff with a
grotty post-processor and it worked.

So I guess I should submit a bug report against groff documentation.
Could something break if nroff is used with linuxdoc since linuxdoc was
designed to use groff?

			David Lawyer

Previous by date: 15 Oct 2005 08:23:33 -0000 Re: linuxdoc text backend, Stein Gjoen
Next by date: 15 Oct 2005 08:23:33 -0000 Re: linuxdoc text backend, David Lawyer
Previous in thread: 15 Oct 2005 08:23:33 -0000 Re: linuxdoc text backend, Stein Gjoen
Next in thread: 15 Oct 2005 08:23:33 -0000 Re: linuxdoc text backend, David Lawyer


  ©The Linux Documentation Project, 2014. Listserver maintained by dr Serge Victor on ibiblio.org servers. See current spam statz.