Ingo Schwarze <[email protected]> wrote:
> 
> G. Branden Robinson wrote:
> 
> I mean, the whole point of -a (and tools like deroff) is to refrain
> from both typesetting and markup and just reduce the input to plain
> text.  If you want any typesetting or markup, just use an output
> device that supports what you want.

From the gtroff(1) manpage:

> -a Generate an ASCII approximation of the typeset output.

This is pretty explicit, spacing and hyphenation are going to be
what they’d be if you sent the output to a printer/typesetter instead.
Maybe we need an option to suppress hyphenation and adjustment,
regardless of what the input specifies. My (nroff-based) WSB version
of deroff has an -s option to remove extra spaces, and it turns off
hyphenation for the big 4: -ms, -mm, -mdoc, -man (and does left
adjustment for the latter two, since they have that available as an
option).

> 1.  report page breaks
> 
> Page breaks are clearly a typesetting feature, so they are among
> the features that deserve to be unconditionally removed.

The sort-of proposed option could do this as well.


> 2.  distinguish "automatic" hyphens from explicit ones
> 
> Automatic hyphenation is clearly a typesetting feature,
> so -a ought to completely disable automatic hyphenation.

The -rHy=0 or -rHY=0 (depending on the package) options do this.
At least of you’re not using -me or a total custom macro package.


>  In plain text output, explicit hyphens should
> simply be plain-text hyphens and nothing else, or the output
> will be some ad-hoc made-up markup language and not plain text.

Groff’s nroff outputs hyphens differently for -Tascii and -Tutf8.
I had to account for this in the WSB hyphen utility. The sort-of
proposed option could normalize those, no?


> Nowadays, the concept of "plain text" could mean either US-ASCII
> or UTF-8 text.  The groff(1) manual page fails to say which one of
> the two it is aiming for.
> From experimentation with 1.25.0rc2, it appears it does neither,
> but instead invents its own (undocumented?) <charname> markup.

This should be explored further. There’s a big difference between
consistency and foolish consistency. 

> The (mostly unmaintained) demandoc(1) utility at least documents
> what it does, which more or less implies that it produces US-ASCII
> output, though it could admittedly be more explicit:

Ingo, if you want to point people to WSB `deroff -mdoc`, I wouldn’t
object. :D

> By definition, plain text cannot represent non-trivial drawing,
> so almost all drawing commands should simply be removed.

Hard agree.

>> 6.  develop a (discardable) notation for device extension commands
> 
> The sounds like an egregious contradiction in itself.  The whole
> point of -a is printing for a plain text device, which by its very
> definition supports no device extensions, so all device extension
> attempts have to result in no output.

Yeah, I think Ingo has the right idea here.


So I would suggest:

* Don’t dork with the -a option, leave it as it is.
* Maybe introduce a new option, that works beside -a, to turn off
  all hyphenation and justification code. This could be our deroff.
* Maybe introduce a new option, that works beside -a, that wraps
  paragraphs onto a single line. This isn’t strictly necessary, since
  WSB’s “deroff -mxx -s <files> | pandoc -f markdown -t plain”
  can do the (un)wrapping, But any block-level analysis tool (and
  any site that doesn’t have pandoc) will nthank you.

This is one of those exceptions where I find myself agreeing with
Ingo more than Brandon. No shade on Ingo intended, it’s just that
I’m more in the groff than mandoc camp.

        Larry


Reply via email to