discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali.rohar@gmail.com>
To: discuss@mandoc.bsd.lv
Subject: Broken tables in HTML output
Date: Mon, 16 Jul 2018 13:03:35 +0200	[thread overview]
Message-ID: <20180716110335.uusqzhscwdgp5qaa@pali> (raw)

Hi!

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

First thing is that in HTML output is fully missing specified border
even when in table section is box or | specified. This makes hard to
understand meaning of some table when borders are important.

Note that in ASCII output borders are rendered by '-', '+', '|' and '='
characters, so seems that mandoc already support borders, just HTML
generator is buggy or does not support them at all.

Second problem is with text alignment in table. When cell spanning is
used (e.g. via s or via \^) then text is not correctly aligned and it
looks "ugly". This problem is in both HTML and ASCII output.

Third thing which I observed is that mandoc is in UTF-8 output does not
use Unicode Box Drawing characters, but rather ugly ASCII.

On following line is (simplified) manpage table:

$ cat test.man
.TS
box;
c s|c s
c|c|c|c
l|l|c|c.
Very long text	Another very long text
_
Short	shrt	val1	val2
=
Name	1	value1	value2
\^	2	value3	\^
\^	3	value4	\^
_
Name2	1	v1	v2
_
Name3	1	vv1	vv2
\^	2	\^	vv4
.TE

And output from groff man in UTF-8 mode is:

$ man -Tutf8 ./test.man
┌───────────────┬────────────────────────┐
│Very long text │ Another very long text │
├───────┬───────┼────────────┬───────────┤
│Short  │ shrt  │   val1     │   val2    │
├───────┼───────┼────────────┼───────────┤
│       │ 1     │  value1    │           │
│Name   │ 2     │  value3    │  value2   │
│       │ 3     │  value4    │           │
├───────┼───────┼────────────┼───────────┤
│Name2  │ 1     │    v1      │    v2     │
├───────┼───────┼────────────┼───────────┤
│Name3  │ 1     │    vv1     │   vv2     │
│       │ 2     │            │   vv4     │
└───────┴───────┴────────────┴───────────┘

Table has nice design, text is properly centered (both horizontally and
vertically) and can be easily read. Only one error is missing double
line between Short and Name rows.

Output from mandoc in UTF-8 mode is ugly:

$ mandoc -Tutf8 ./test.man
+----------------------+---------------------------------+
|   Very long text     |     Another very long text      |
+---------------+------+------------------------+--------+
|    Short      | shrt |          val1          |  val2  |
+===============+======+========================+========+
|Name           | 1    |         value1         | value2 |
|               | 2    |         value3         |        |
|               | 3    |         value4         |        |
+---------------+------+------------------------+--------+
|Name2          | 1    |           v1           |   v2   |
+---------------+------+------------------------+--------+
|Name3          | 1    |          vv1           |  vv2   |
|               | 2    |                        |  vv4   |
+---------------+------+------------------------+--------+

It looks like it is no UTF-8, but rather ASCII.

Column for val1 is enormously wide and val2 is too short without any
reason. Both val1 and val2 columns have members of same sizes...

Alignment is wrong. "Name" should be centered and not on top. Same for
"value2".

And now HTML output from mandoc:

$ mandoc -Thtml ./test.man > test.html

In web browser test.html file looks like this:

   Very long text      Another very long text
   Short          shrt val1                   val2
   Name           1    value1                 value2
                  2    value3
                  3    value4
   Name2          1    v1                     v2
   Name3          1    vv1                    vv2
                  2                           vv4

All borders are missing, cell spanning is broken, text is not aligned at
all. Basically nothing is working and it hard to read and understood
what this table means.

So can you fix HTML generator in mandoc to produce better formatted HTML
text. Because now ASCII version is better then what produce HTML.

-- 
Pali Rohár
pali.rohar@gmail.com
--
 To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv

             reply	other threads:[~2018-07-16 11:12 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-16 11:03 Pali Rohár [this message]
2018-07-16 15:29 ` Ingo Schwarze
2018-07-16 16:36   ` Pali Rohár
2018-07-16 17:44     ` Ingo Schwarze
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=20180716110335.uusqzhscwdgp5qaa@pali \
    --to=pali.rohar@gmail.com \
    --cc=discuss@mandoc.bsd.lv \
    /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).