From d87fd9991b3f2008e4d248991fdf4d47390c4704 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 6 Jul 2022 14:34:59 +0000 Subject: While the HTML standard allows multiple

elements in the same document,

is intended for top level headers, and most of the sections in a manual page can hardly be considered top-level. It is more usual to use

only for the main title of the document of for the site name. Consequently, move .Sh/.SH from

to

and .Ss/.SS from

to

, freeing

for use by header.html in man.cgi(8). Discussed with Anna Vyalkova . --- html.c | 4 ++-- html.h | 4 ++-- man_html.c | 6 +++--- mandoc.css | 20 ++++++++++---------- mdoc_html.c | 8 ++++---- regress/man/IP/literal.out_html | 8 ++++---- regress/man/SH/paragraph.out_html | 4 ++-- regress/man/SS/paragraph.out_html | 8 ++++---- regress/man/TP/vert.out_html | 2 +- regress/mdoc/Er/tag.out_html | 2 +- regress/mdoc/Rs/paragraph.out_html | 4 ++-- regress/mdoc/Sh/paragraph.out_html | 4 ++-- regress/mdoc/Sh/tag.out_html | 14 +++++++------- regress/mdoc/Tg/warn.out_html | 4 ++-- 14 files changed, 46 insertions(+), 46 deletions(-) diff --git a/html.c b/html.c index 07ca63f7..bda1947b 100644 --- a/html.c +++ b/html.c @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.277 2022/07/03 14:29:44 schwarze Exp $ */ +/* $Id: html.c,v 1.278 2022/07/06 14:34:59 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2011-2015, 2017-2021 Ingo Schwarze @@ -81,8 +81,8 @@ static const struct htmldata htmltags[TAG_MAX] = { {"dl", HTML_NLALL | HTML_INDENT}, {"dt", HTML_NLAROUND}, {"dd", HTML_NLAROUND | HTML_INDENT}, - {"h1", HTML_TOPHRASE | HTML_NLAROUND}, {"h2", HTML_TOPHRASE | HTML_NLAROUND}, + {"h3", HTML_TOPHRASE | HTML_NLAROUND}, {"p", HTML_TOPHRASE | HTML_NLAROUND | HTML_INDENT}, {"pre", HTML_TOPHRASE | HTML_NLAROUND | HTML_NOINDENT}, {"a", HTML_INPHRASE | HTML_TOPHRASE}, diff --git a/html.h b/html.h index 7c73fa4b..49ae0f72 100644 --- a/html.h +++ b/html.h @@ -1,4 +1,4 @@ -/* $Id: html.h,v 1.111 2022/07/03 14:29:44 schwarze Exp $ */ +/* $Id: html.h,v 1.112 2022/07/06 14:34:59 schwarze Exp $ */ /* * Copyright (c) 2017, 2018, 2019, 2020 Ingo Schwarze * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons @@ -40,8 +40,8 @@ enum htmltag { TAG_DL, TAG_DT, TAG_DD, - TAG_H1, TAG_H2, + TAG_H3, TAG_P, TAG_PRE, TAG_A, diff --git a/man_html.c b/man_html.c index 19337a10..6ad35578 100644 --- a/man_html.c +++ b/man_html.c @@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.182 2022/07/05 21:25:29 schwarze Exp $ */ +/* $Id: man_html.c,v 1.183 2022/07/06 14:34:59 schwarze Exp $ */ /* * Copyright (c) 2013-2015,2017-2020,2022 Ingo Schwarze * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons @@ -316,10 +316,10 @@ man_SH_pre(MAN_ARGS) enum htmltag tag; if (n->tok == MAN_SH) { - tag = TAG_H1; + tag = TAG_H2; class = "Sh"; } else { - tag = TAG_H2; + tag = TAG_H3; class = "Ss"; } switch (n->type) { diff --git a/mandoc.css b/mandoc.css index f2b5e733..1dae1270 100644 --- a/mandoc.css +++ b/mandoc.css @@ -1,4 +1,4 @@ -/* $Id: mandoc.css,v 1.51 2022/07/05 21:25:29 schwarze Exp $ */ +/* $Id: mandoc.css,v 1.52 2022/07/06 14:34:59 schwarze Exp $ */ /* * Standard style sheet for mandoc(1) -Thtml and man.cgi(8). * @@ -16,7 +16,7 @@ html { max-width: 65em; body { background: var(--bg); color: var(--fg); font-family: Helvetica,Arial,sans-serif; } -h1 { font-size: 110%; } +h1, h2 { font-size: 110%; } table { margin-top: 0em; margin-bottom: 0em; border-collapse: collapse; } @@ -81,11 +81,11 @@ div[role=doc-pagefooter] { main { margin-left: 3.8em; } .Nd { } section.Sh { } -h1.Sh { margin-top: 1.2em; +h2.Sh { margin-top: 1.2em; margin-bottom: 0.6em; margin-left: -3.2em; } section.Ss { } -h2.Ss { margin-top: 1.2em; +h3.Ss { margin-top: 1.2em; margin-bottom: 0.6em; margin-left: -1.2em; font-size: 105%; } @@ -271,7 +271,7 @@ a.In { } /* Tooltip support. */ -h1.Sh, h2.Ss { position: relative; } +h2.Sh, h3.Ss { position: relative; } .An, .Ar, .Cd, .Cm, .Dv, .Em, .Er, .Ev, .Fa, .Fd, .Fl, .Fn, .Ft, .Ic, code.In, .Lb, .Lk, .Ms, .Mt, .Nd, code.Nm, .Pa, .Rs, .St, .Sx, .Sy, .Va, .Vt, .Xr { @@ -301,8 +301,8 @@ code.In::before { content: "In"; } code.Nm::before { content: "Nm"; } .Pa::before { content: "Pa"; } .Rs::before { content: "Rs"; } -h1.Sh::before { content: "Sh"; } -h2.Ss::before { content: "Ss"; } +h2.Sh::before { content: "Sh"; } +h3.Ss::before { content: "Ss"; } .St::before { content: "St"; } .Sx::before { content: "Sx"; } .Sy::before { content: "Sy"; } @@ -316,7 +316,7 @@ h2.Ss::before { content: "Ss"; } .Ic::before, code.In::before, .Lb::before, .Lk::before, .Ms::before, .Mt::before, .Nd::before, code.Nm::before, .Pa::before, .Rs::before, -h1.Sh::before, h2.Ss::before, .St::before, .Sx::before, .Sy::before, +h2.Sh::before, h3.Ss::before, .St::before, .Sx::before, .Sy::before, .Va::before, .Vt::before, .Xr::before { opacity: 0; transition: .15s ease opacity; @@ -337,7 +337,7 @@ h1.Sh::before, h2.Ss::before, .St::before, .Sx::before, .Sy::before, .Ft:hover::before, .Ic:hover::before, code.In:hover::before, .Lb:hover::before, .Lk:hover::before, .Ms:hover::before, .Mt:hover::before, .Nd:hover::before, code.Nm:hover::before, .Pa:hover::before, -.Rs:hover::before, h1.Sh:hover::before, h2.Ss:hover::before, .St:hover::before, +.Rs:hover::before, h2.Sh:hover::before, h3.Ss:hover::before, .St:hover::before, .Sx:hover::before, .Sy:hover::before, .Va:hover::before, .Vt:hover::before, .Xr:hover::before { opacity: 1; @@ -347,7 +347,7 @@ h1.Sh::before, h2.Ss::before, .St::before, .Sx::before, .Sy::before, @media (max-width: 37.5em) { main { margin-left: 0.5em; } -h1.Sh, h2.Ss { margin-left: 0em; } +h2.Sh, h3.Ss { margin-left: 0em; } .Bd-indent { margin-left: 2em; } .Bl-hang > dd { margin-left: 2em; } diff --git a/mdoc_html.c b/mdoc_html.c index bd731ddf..1193c61c 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.347 2022/07/05 21:25:29 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.348 2022/07/06 14:34:59 schwarze Exp $ */ /* * Copyright (c) 2014-2022 Ingo Schwarze * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons @@ -541,7 +541,7 @@ mdoc_sh_pre(MDOC_ARGS) if (sc < 2) break; tnav = print_otag(h, TAG_NAV, "r", "doc-toc"); - t = print_otag(h, TAG_H1, "c", "Sh"); + t = print_otag(h, TAG_H2, "c", "Sh"); print_text(h, "TABLE OF CONTENTS"); print_tagq(h, t); t = print_otag(h, TAG_UL, "c", "Bl-compact"); @@ -576,7 +576,7 @@ mdoc_sh_pre(MDOC_ARGS) print_otag(h, TAG_SECTION, "c", "Sh"); break; case ROFFT_HEAD: - print_otag_id(h, TAG_H1, "Sh", n); + print_otag_id(h, TAG_H2, "Sh", n); break; case ROFFT_BODY: if (n->sec == SEC_AUTHORS) @@ -597,7 +597,7 @@ mdoc_ss_pre(MDOC_ARGS) print_otag(h, TAG_SECTION, "c", "Ss"); break; case ROFFT_HEAD: - print_otag_id(h, TAG_H2, "Ss", n); + print_otag_id(h, TAG_H3, "Ss", n); break; case ROFFT_BODY: break; diff --git a/regress/man/IP/literal.out_html b/regress/man/IP/literal.out_html index ceb26a56..00042b90 100644 --- a/regress/man/IP/literal.out_html +++ b/regress/man/IP/literal.out_html @@ -18,8 +18,8 @@ literal paragraph regular text
-

+

regular text

literal
 text
@@ -34,8 +34,8 @@ text

new regular paragraph

-

+

regular text

diff --git a/regress/man/SH/paragraph.out_html b/regress/man/SH/paragraph.out_html index abe932b4..aef8d35c 100644 --- a/regress/man/SH/paragraph.out_html +++ b/regress/man/SH/paragraph.out_html @@ -1,8 +1,8 @@
-

+

This text immediately follows a section header.

This is a paragraph.

-

+

diff --git a/regress/man/SS/paragraph.out_html b/regress/man/SS/paragraph.out_html index 22591deb..dcfaf591 100644 --- a/regress/man/SS/paragraph.out_html +++ b/regress/man/SS/paragraph.out_html @@ -1,9 +1,9 @@
-

+

This text immediately follows a subsection header.

This is a paragraph.

-

+

diff --git a/regress/man/TP/vert.out_html b/regress/man/TP/vert.out_html index 4499432b..96544b3e 100644 --- a/regress/man/TP/vert.out_html +++ b/regress/man/TP/vert.out_html @@ -1,6 +1,6 @@
-

+

text
diff --git a/regress/mdoc/Er/tag.out_html b/regress/mdoc/Er/tag.out_html index 80daa28b..081ca1ea 100644 --- a/regress/mdoc/Er/tag.out_html +++ b/regress/mdoc/Er/tag.out_html @@ -5,7 +5,7 @@
-

+

[]
text
diff --git a/regress/mdoc/Rs/paragraph.out_html b/regress/mdoc/Rs/paragraph.out_html index bfb0a724..0a4fc8a3 100644 --- a/regress/mdoc/Rs/paragraph.out_html +++ b/regress/mdoc/Rs/paragraph.out_html @@ -5,8 +5,8 @@ author, another book.

-

+

initial reference:

author name, book title.

diff --git a/regress/mdoc/Sh/paragraph.out_html b/regress/mdoc/Sh/paragraph.out_html index 82ede5be..7dc93653 100644 --- a/regress/mdoc/Sh/paragraph.out_html +++ b/regress/mdoc/Sh/paragraph.out_html @@ -1,9 +1,9 @@

descriptive text

-

+

initial subsection text

subsection paragraph

-

+

diff --git a/regress/mdoc/Sh/tag.out_html b/regress/mdoc/Sh/tag.out_html index 0dd39398..94332652 100644 --- a/regress/mdoc/Sh/tag.out_html +++ b/regress/mdoc/Sh/tag.out_html @@ -2,26 +2,26 @@
-

+

Text in duplicate description section.

-

+

Text introducing examples.

-

+

Example text.

-

+

More example text.

-

+

Text in weird section.

-

 

+

 

Text in section with empty header.

diff --git a/regress/mdoc/Tg/warn.out_html b/regress/mdoc/Tg/warn.out_html index a7f92574..cd542ba9 100644 --- a/regress/mdoc/Tg/warn.out_html +++ b/regress/mdoc/Tg/warn.out_html @@ -2,10 +2,10 @@ too many badstart badend whitespace

-

+

subtext

-

+

example text

-- cgit v1.2.3-56-ge451