discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: Pali Rohar <pali.rohar@gmail.com>
Cc: discuss@mandoc.bsd.lv
Subject: Re: Broken tables in HTML output
Date: Mon, 16 Jul 2018 19:44:48 +0200	[thread overview]
Message-ID: <20180716174448.GA93710@athene.usta.de> (raw)
In-Reply-To: <20180716163656.ttlmwsdtjvcsyadc@pali>

Hi Pali,

Pali Rohar wrote on Mon, Jul 16, 2018 at 06:36:56PM +0200:
> On Monday 16 July 2018 17:29:19 Ingo Schwarze wrote:
>> Pali Rohar wrote on Mon, Jul 16, 2018 at 01:03:35PM +0200:

>>> It seems that mandoc is not able to format tables in HTML output
>>> correctly.  Output is rather ugly which makes it less readable.

>> You have designed a very complicated table for testing, exercising
>> many advanced features of the tbl(7) language:

> Complicated? This is just simplified version of real used table in man
> page. E.g.: https://github.com/pali/udftools/blob/master/doc/mkudffs.8

As i already said in my EuroBSDCon 2014 tutorial "Let's make manuals
more useful!" (slide 54, Handling manual pages in ports):

  The Law of Feature Creep
    If a software offers some feature,
    sooner or later somebody will use it.

  Porting corollary
    For every feature of the roff language (and for every groff
    extension), no matter how arcane and how obviously irrelevant
    for manual pages, sooner or later somebody will want to port a
    third-party software abusing that feature to format its manual
    pages.

In my recent BSDCan 2018 slides, you can see many of the recent
improvements in mandoc to cope with this awful effect.  They were
mostly related to low-level roff - and also to quite some tbl(7).

If a feature is used by a real-world manual page, that doesn't mean
much, in particular not that it is a feature normally used in manual
pages.  So yes, the features you are asking for are very unusual
in manual pages, and they are very advanced, complicated features.

Consequently, that manual page is totally non-portable.
Here is, for example, what Heirloom Roff does with it:

   $ export PATH="/usr/local/heirloom-doctools/bin:$PATH"
   $ tbl -Tutf8 tmp.man | nroff -man -Tutf8
[...]
       _________________________________________
        Very long text   Another very long text
       _________________________________________
         Short    shrt       val1         val2
       _________________________________________
                  1         value1
                  2         value3
ame
                  3         value4alue2

       _________________________________________
        Name2     1           v1           v2
       _________________________________________
                  1                       vv2
        Name3     2           vv1         vv4
       _________________________________________

All that said, ultimately, i do want to add these features, it just
can't happen overnight.  As opposed to many other non-standard
features that had to be implemented (many of which are used more
frequently), these are actually somewhat useful for unusually
complicated manual pages, as long as authors are aware that their
manual pages will not be portable.

>>> Because now ASCII version is better then what produce HTML.

>> Absolutely.  ASCII output is always better than HTML.  We consider
>> terminal output by far the most important output mode in OpenBSD.
>> But lately, HTML has also be improved in many respects, and that
>> work will continue.  The importance of HTML output is increasing.

> I was told that mandoc has support for formatting manpages to HTML
> and it is really good,

The correct statement is: mandoc HTML output is much better than
groff HTML output.

> therefore I tested it on some manpages (like above).
> And I had to say that no. ASCII of mandoc is better.

Absolutely.  I never said HTML output is better than ASCII output -
neither for mandoc nor for groff.

> And when I compared table ASCII table generated by mandoc and groff,
> groff output is better.

Yes, for complicated tables, groff terminal output is still better
than mandoc terminal output, though the gap is slowly narrowing.

> So based on your reply, all those reports are not supported by mandoc
> yet and marked as TODO...
> 
> I hope that they will be resolved, specially now when e.g. Arch Linux
> and Debian started to generate HTML versions of manpages by mandoc.
> Because otherwise it would be better to stick with UTF-8 output from
> groff and do some HTMLization of plain text output...

Sacrifice hyperlinking and semantic markup on all pages for some
arcane tbl(7) features used by very few pages?  I don't think that
would be an improvement.

Besides, Debian cannot easily switch back because groff is simply
too slow.

> About borders in html tables, I think that all is possible to describe
> via CSS properties like buttom-border, left-border, etc, ...

Very probably, yes.

Yours,
  Ingo
--
 To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv

  reply	other threads:[~2018-07-16 17:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-16 11:03 Pali Rohár
2018-07-16 15:29 ` Ingo Schwarze
2018-07-16 16:36   ` Pali Rohár
2018-07-16 17:44     ` Ingo Schwarze [this message]
2018-11-24 23:15   ` Ingo Schwarze
2018-11-25 19:34   ` Ingo Schwarze
2018-11-25 21:25     ` Ingo Schwarze
2018-11-26  8:53       ` Pali Rohár
2018-11-26 21:27   ` Ingo Schwarze
2018-11-26 21:58     ` Pali Rohár
2018-11-26 22:01       ` Pali Rohár
2018-11-26 22:05         ` Pali Rohár
2018-12-01 17:20           ` Ingo Schwarze
2018-12-01 19:35             ` Pali Rohár
2018-12-03 20:46             ` Pali Rohár
2018-12-04  5:33               ` Ingo Schwarze
2018-12-03 22:01             ` Pali Rohár
2018-12-03 22:14               ` Ingo Schwarze
2018-12-03 22:20                 ` Pali Rohár
2018-12-03 22:37                   ` Ingo Schwarze
2018-12-04 16:44                     ` Pali Rohár
2018-12-04 18:04                       ` Ingo Schwarze
2019-01-21  9:39                         ` Pali Rohár
2019-01-21 13:16                           ` Ingo Schwarze
2018-11-29  2:15     ` Ingo Schwarze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180716174448.GA93710@athene.usta.de \
    --to=schwarze@usta.de \
    --cc=discuss@mandoc.bsd.lv \
    --cc=pali.rohar@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).