From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28583 invoked from network); 6 Jul 2022 12:44:05 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 6 Jul 2022 12:44:05 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id a3b2faa3 for ; Wed, 6 Jul 2022 07:44:03 -0500 (EST) Received: from scc-mailout-kit-01.scc.kit.edu (scc-mailout-kit-01.scc.kit.edu [129.13.231.81]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id c9e3276b for ; Wed, 6 Jul 2022 07:44:02 -0500 (EST) Received: from hekate.asta.kit.edu ([2a00:1398:5:f401::77]) by scc-mailout-kit-01.scc.kit.edu with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (envelope-from ) id 1o94Ns-00GWSI-Pn; Wed, 06 Jul 2022 14:44:01 +0200 Received: from login-1.asta.kit.edu ([2a00:1398:5:f400::72]) by hekate.asta.kit.edu with esmtp (Exim 4.94.2) (envelope-from ) id 1o94Nq-006LGG-Sv; Wed, 06 Jul 2022 14:43:59 +0200 Received: from schwarze by login-1.asta.kit.edu with local (Exim 4.92) (envelope-from ) id 1o94Nr-0007ym-9H; Wed, 06 Jul 2022 14:43:59 +0200 Date: Wed, 6 Jul 2022 14:43:59 +0200 From: Ingo Schwarze To: Anna Cc: tech@mandoc.bsd.lv Subject: patch: avoid multiple

Message-ID: X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello Anna, do we want the following patch? I just installed it for testing on man.bsd.lv. The rationale goes as follows: While the HTML standard explicitely allows documents containing more than one

, it contains several examples of header hierarchies, and only a single one among these examples contains more than one

. That example seems a bit contrived, too. Most users expect to find a single

containing the main title of the document. As far as i understand, if there is more than one

, that may easily confuse blind users. I see no good reason why mandoc should write multiple

headers in a single manual page. Logically, sections like ENVIRONMENT, EXAMPLES, DIAGNOSTICS, HISTORY, AUTHORS can hardly be considered top-level. They feel like subdivisions of a document, the top level title of which is provided in the NAME section. If we do this, we could afterwards consider an optional second step: * Turn the mdoc(7)/man(7) NAME section into an
. * Use

for the .Nm in the NAME section. * Use

for the .Nd in the .Nm section. Or something like that. On a related note, i think the widespread practice of putting

into header.html (seen on man.bsd.lv, man.openbsd.org, and www.freebsd.org/cgi/man.cgi) is wrong. I think a more normal element like

should be used there, but that is yet another later step. What do you think? Ingo Index: html.c =================================================================== RCS file: /cvs/src/usr.bin/mandoc/html.c,v retrieving revision 1.148 diff -u -p -r1.148 html.c --- html.c 3 Jul 2022 14:28:26 -0000 1.148 +++ html.c 6 Jul 2022 11:45:33 -0000 @@ -79,8 +79,8 @@ static const struct htmldata htmltags[TA {"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}, Index: html.h =================================================================== RCS file: /cvs/src/usr.bin/mandoc/html.h,v retrieving revision 1.73 diff -u -p -r1.73 html.h --- html.h 3 Jul 2022 14:28:27 -0000 1.73 +++ html.h 6 Jul 2022 11:45:33 -0000 @@ -40,8 +40,8 @@ enum htmltag { TAG_DL, TAG_DT, TAG_DD, - TAG_H1, TAG_H2, + TAG_H3, TAG_P, TAG_PRE, TAG_A, Index: man_html.c =================================================================== RCS file: /cvs/src/usr.bin/mandoc/man_html.c,v retrieving revision 1.135 diff -u -p -r1.135 man_html.c --- man_html.c 5 Jul 2022 21:25:23 -0000 1.135 +++ man_html.c 6 Jul 2022 11:45:33 -0000 @@ -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) { Index: mandoc.css =================================================================== RCS file: /cvs/src/usr.bin/mandoc/mandoc.css,v retrieving revision 1.38 diff -u -p -r1.38 mandoc.css --- mandoc.css 5 Jul 2022 21:25:24 -0000 1.38 +++ mandoc.css 6 Jul 2022 11:45:33 -0000 @@ -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%; } +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::befor .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::befor @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; } Index: mdoc_html.c =================================================================== RCS file: /cvs/src/usr.bin/mandoc/mdoc_html.c,v retrieving revision 1.222 diff -u -p -r1.222 mdoc_html.c --- mdoc_html.c 5 Jul 2022 21:25:24 -0000 1.222 +++ mdoc_html.c 6 Jul 2022 11:45:33 -0000 @@ -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; -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv