From 00b92a3f667b1b2e3a2ae04c788cc2b374cbd0ba Mon Sep 17 00:00:00 2001 From: schwarze Date: Wed, 6 Jul 2022 14:27:54 +0000 Subject: [PATCH] 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 . --- .../usr.bin/mandoc/man/IP/literal.out_html | 8 ++++---- .../usr.bin/mandoc/man/SH/paragraph.out_html | 4 ++-- .../usr.bin/mandoc/man/SS/paragraph.out_html | 8 ++++---- regress/usr.bin/mandoc/man/TP/vert.out_html | 2 +- regress/usr.bin/mandoc/mdoc/Er/tag.out_html | 2 +- .../usr.bin/mandoc/mdoc/Rs/paragraph.out_html | 4 ++-- .../usr.bin/mandoc/mdoc/Sh/paragraph.out_html | 4 ++-- regress/usr.bin/mandoc/mdoc/Sh/tag.out_html | 14 ++++++------- regress/usr.bin/mandoc/mdoc/Tg/warn.out_html | 4 ++-- usr.bin/mandoc/html.c | 4 ++-- usr.bin/mandoc/html.h | 4 ++-- usr.bin/mandoc/man_html.c | 6 +++--- usr.bin/mandoc/mandoc.css | 20 +++++++++---------- usr.bin/mandoc/mdoc_html.c | 8 ++++---- 14 files changed, 46 insertions(+), 46 deletions(-) diff --git a/regress/usr.bin/mandoc/man/IP/literal.out_html b/regress/usr.bin/mandoc/man/IP/literal.out_html index ceb26a561ec..00042b90868 100644 --- a/regress/usr.bin/mandoc/man/IP/literal.out_html +++ b/regress/usr.bin/mandoc/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/usr.bin/mandoc/man/SH/paragraph.out_html b/regress/usr.bin/mandoc/man/SH/paragraph.out_html index abe932b4d5a..aef8d35c311 100644 --- a/regress/usr.bin/mandoc/man/SH/paragraph.out_html +++ b/regress/usr.bin/mandoc/man/SH/paragraph.out_html @@ -1,8 +1,8 @@
-

+

This text immediately follows a section header.

This is a paragraph.

-

+

diff --git a/regress/usr.bin/mandoc/man/SS/paragraph.out_html b/regress/usr.bin/mandoc/man/SS/paragraph.out_html index 22591deb759..dcfaf5914fa 100644 --- a/regress/usr.bin/mandoc/man/SS/paragraph.out_html +++ b/regress/usr.bin/mandoc/man/SS/paragraph.out_html @@ -1,9 +1,9 @@
-

+

This text immediately follows a subsection header.

This is a paragraph.

-

+

diff --git a/regress/usr.bin/mandoc/man/TP/vert.out_html b/regress/usr.bin/mandoc/man/TP/vert.out_html index 4499432b1a5..96544b3e53e 100644 --- a/regress/usr.bin/mandoc/man/TP/vert.out_html +++ b/regress/usr.bin/mandoc/man/TP/vert.out_html @@ -1,6 +1,6 @@
-

+

text
diff --git a/regress/usr.bin/mandoc/mdoc/Er/tag.out_html b/regress/usr.bin/mandoc/mdoc/Er/tag.out_html index 80daa28b798..081ca1ea0fc 100644 --- a/regress/usr.bin/mandoc/mdoc/Er/tag.out_html +++ b/regress/usr.bin/mandoc/mdoc/Er/tag.out_html @@ -5,7 +5,7 @@
-

+

[]
text
diff --git a/regress/usr.bin/mandoc/mdoc/Rs/paragraph.out_html b/regress/usr.bin/mandoc/mdoc/Rs/paragraph.out_html index bfb0a7240c2..0a4fc8a3ac3 100644 --- a/regress/usr.bin/mandoc/mdoc/Rs/paragraph.out_html +++ b/regress/usr.bin/mandoc/mdoc/Rs/paragraph.out_html @@ -5,8 +5,8 @@ author, another book.

-

+

initial reference:

author name, book title.

diff --git a/regress/usr.bin/mandoc/mdoc/Sh/paragraph.out_html b/regress/usr.bin/mandoc/mdoc/Sh/paragraph.out_html index 82ede5beac5..7dc93653a32 100644 --- a/regress/usr.bin/mandoc/mdoc/Sh/paragraph.out_html +++ b/regress/usr.bin/mandoc/mdoc/Sh/paragraph.out_html @@ -1,9 +1,9 @@

descriptive text

-

+

initial subsection text

subsection paragraph

-

+

diff --git a/regress/usr.bin/mandoc/mdoc/Sh/tag.out_html b/regress/usr.bin/mandoc/mdoc/Sh/tag.out_html index 0dd39398470..94332652d0d 100644 --- a/regress/usr.bin/mandoc/mdoc/Sh/tag.out_html +++ b/regress/usr.bin/mandoc/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/usr.bin/mandoc/mdoc/Tg/warn.out_html b/regress/usr.bin/mandoc/mdoc/Tg/warn.out_html index a7f925740d0..cd542ba93aa 100644 --- a/regress/usr.bin/mandoc/mdoc/Tg/warn.out_html +++ b/regress/usr.bin/mandoc/mdoc/Tg/warn.out_html @@ -2,10 +2,10 @@ too many badstart badend whitespace

-

+

subtext

-

+

example text

diff --git a/usr.bin/mandoc/html.c b/usr.bin/mandoc/html.c index 4b582323cfc..68db54b54e5 100644 --- a/usr.bin/mandoc/html.c +++ b/usr.bin/mandoc/html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: html.c,v 1.148 2022/07/03 14:28:26 schwarze Exp $ */ +/* $OpenBSD: html.c,v 1.149 2022/07/06 14:27:55 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2011-2015, 2017-2021 Ingo Schwarze @@ -79,8 +79,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/usr.bin/mandoc/html.h b/usr.bin/mandoc/html.h index 7e5b02937f1..10edfd8abd3 100644 --- a/usr.bin/mandoc/html.h +++ b/usr.bin/mandoc/html.h @@ -1,4 +1,4 @@ -/* $OpenBSD: html.h,v 1.73 2022/07/03 14:28:27 schwarze Exp $ */ +/* $OpenBSD: html.h,v 1.74 2022/07/06 14:27:55 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/usr.bin/mandoc/man_html.c b/usr.bin/mandoc/man_html.c index ae462939063..0943c347f77 100644 --- a/usr.bin/mandoc/man_html.c +++ b/usr.bin/mandoc/man_html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: man_html.c,v 1.135 2022/07/05 21:25:23 schwarze Exp $ */ +/* $OpenBSD: man_html.c,v 1.136 2022/07/06 14:27:55 schwarze Exp $ */ /* * Copyright (c) 2013-2015,2017-2020,2022 Ingo Schwarze * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons @@ -314,10 +314,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/usr.bin/mandoc/mandoc.css b/usr.bin/mandoc/mandoc.css index b5b4ae7523b..6bfce467d64 100644 --- a/usr.bin/mandoc/mandoc.css +++ b/usr.bin/mandoc/mandoc.css @@ -1,4 +1,4 @@ -/* $OpenBSD: mandoc.css,v 1.38 2022/07/05 21:25:24 schwarze Exp $ */ +/* $OpenBSD: mandoc.css,v 1.39 2022/07/06 14:27:55 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/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c index 2a0c58c9dc7..7d324569de5 100644 --- a/usr.bin/mandoc/mdoc_html.c +++ b/usr.bin/mandoc/mdoc_html.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_html.c,v 1.222 2022/07/05 21:25:24 schwarze Exp $ */ +/* $OpenBSD: mdoc_html.c,v 1.223 2022/07/06 14:27:55 schwarze Exp $ */ /* * Copyright (c) 2014-2022 Ingo Schwarze * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons @@ -539,7 +539,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"); @@ -574,7 +574,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) @@ -595,7 +595,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; -- 2.20.1