discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
* Broken tables in HTML output
@ 2018-07-16 11:03 Pali Rohár
  2018-07-16 15:29 ` Ingo Schwarze
  0 siblings, 1 reply; 25+ messages in thread
From: Pali Rohár @ 2018-07-16 11:03 UTC (permalink / raw)
  To: discuss

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2019-01-21 13:16 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-16 11:03 Broken tables in HTML output 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
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

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).