tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: Anna Vyalkova <cyber@sysrq.in>
Cc: tech@mandoc.bsd.lv
Subject: Re: [PATCH 2/3] Wrap manual text in the "<main>" tag
Date: Sun, 3 Jul 2022 16:41:49 +0200	[thread overview]
Message-ID: <YsGqrZ5hpqImsAMG@asta-kit.de> (raw)
In-Reply-To: <20220628181844.15484-3-cyber@sysrq.in>

Hello Anna,

Anna Vyalkova wrote on Tue, Jun 28, 2022 at 11:18:43PM +0500:

>  html.c      | 1 +
>  html.h      | 1 +
>  man_html.c  | 2 +-
>  mandoc.css  | 3 +--
>  mdoc_html.c | 2 +-
>  5 files changed, 5 insertions(+), 4 deletions(-)
[...]
> -	t = print_otag(h, TAG_DIV, "c", "manual-text");
> +	t = print_otag(h, TAG_MAIN, "c", "manual-text");
[...]

Thank you!

I committed your patch in the form appended below.
In particular, there was a second instance of ".manual-text"
for the benefit of mobile devices.

Yours,
  Ingo


Log Message:
-----------
Instead of the custom <div class="manual-text">, use the standard 
HTML <main> element.  The benefit is that it has the ARIA landmark 
role "main" by default.  To ease the transition for people using 
their own CSS file instead of mandoc.css, retain the custom class
for now.

I had this idea in a discussion with Anna Vyalkova <cyber at sysrq dot in>.
Patch from Anna, slightly tweaked by me.

Modified Files:
--------------
    mandoc:
        html.c
        html.h
        man_html.c
        mandoc.css
        mdoc_html.c

Revision Data
-------------
Index: mandoc.css
===================================================================
RCS file: /home/cvs/mandoc/mandoc/mandoc.css,v
retrieving revision 1.49
retrieving revision 1.50
diff -Lmandoc.css -Lmandoc.css -u -p -r1.49 -r1.50
--- mandoc.css
+++ mandoc.css
@@ -69,8 +69,7 @@ td.foot-os {	text-align: right; }
 
 /* Sections and paragraphs. */
 
-.manual-text {
-		margin-left: 3.8em; }
+main {		margin-left: 3.8em; }
 .Nd { }
 section.Sh { }
 h1.Sh {		margin-top: 1.2em;
@@ -338,8 +337,7 @@ h1.Sh::before, h2.Ss::before, .St::befor
 /* Overrides to avoid excessive margins on small devices. */
 
 @media (max-width: 37.5em) {
-.manual-text {
-		margin-left: 0.5em; }
+main {		margin-left: 0.5em; }
 h1.Sh, h2.Ss {	margin-left: 0em; }
 .Bd-indent {	margin-left: 2em; }
 .Bl-hang > dd {
Index: html.h
===================================================================
RCS file: /home/cvs/mandoc/mandoc/html.h,v
retrieving revision 1.110
retrieving revision 1.111
diff -Lhtml.h -Lhtml.h -u -p -r1.110 -r1.111
--- html.h
+++ html.h
@@ -27,6 +27,7 @@ enum	htmltag {
 	TAG_STYLE,
 	TAG_TITLE,
 	TAG_BODY,
+	TAG_MAIN,
 	TAG_DIV,
 	TAG_SECTION,
 	TAG_NAV,
Index: mdoc_html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/mdoc_html.c,v
retrieving revision 1.344
retrieving revision 1.345
diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.344 -r1.345
--- mdoc_html.c
+++ mdoc_html.c
@@ -302,7 +302,7 @@ html_mdoc(void *arg, const struct roff_m
 	}
 
 	mdoc_root_pre(mdoc, h);
-	t = print_otag(h, TAG_DIV, "c", "manual-text");
+	t = print_otag(h, TAG_MAIN, "c", "manual-text");
 	print_mdoc_nodelist(mdoc, n, h);
 	print_tagq(h, t);
 	mdoc_root_post(mdoc, h);
Index: man_html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/man_html.c,v
retrieving revision 1.179
retrieving revision 1.180
diff -Lman_html.c -Lman_html.c -u -p -r1.179 -r1.180
--- man_html.c
+++ man_html.c
@@ -132,7 +132,7 @@ html_man(void *arg, const struct roff_me
 	}
 
 	man_root_pre(man, h);
-	t = print_otag(h, TAG_DIV, "c", "manual-text");
+	t = print_otag(h, TAG_MAIN, "c", "manual-text");
 	print_man_nodelist(man, n, h);
 	print_tagq(h, t);
 	man_root_post(man, h);
Index: html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/html.c,v
retrieving revision 1.276
retrieving revision 1.277
diff -Lhtml.c -Lhtml.c -u -p -r1.276 -r1.277
--- html.c
+++ html.c
@@ -2,6 +2,7 @@
 /*
  * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2011-2015, 2017-2021 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2022 Anna Vyalkova <cyber@sysrq.in>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -67,6 +68,7 @@ static	const struct htmldata htmltags[TA
 	{"style",	HTML_NLALL | HTML_INDENT},
 	{"title",	HTML_NLAROUND},
 	{"body",	HTML_NLALL},
+	{"main",	HTML_NLALL},
 	{"div",		HTML_NLAROUND},
 	{"section",	HTML_NLALL},
 	{"nav",		HTML_NLALL},
--
 To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv


  reply	other threads:[~2022-07-03 14:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28 18:18 [PATCH 0/3] Add HTML landmarks Anna Vyalkova
2022-06-28 18:18 ` [PATCH 1/3] Wrap manual header in the "<header>" tag Anna Vyalkova
2022-07-03 17:24   ` Ingo Schwarze
2022-07-03 18:49     ` Anna Vyalkova
2022-07-03 20:12       ` Ingo Schwarze
2022-07-03 20:51         ` Anna “CyberTailor”
2022-07-05 15:16           ` Ingo Schwarze
2022-07-05 16:15             ` Anna
2022-07-05 18:45               ` Ingo Schwarze
2022-07-05 19:03                 ` Anna
2022-07-05 21:39                   ` Ingo Schwarze
2022-06-28 18:18 ` [PATCH 2/3] Wrap manual text in the "<main>" tag Anna Vyalkova
2022-07-03 14:41   ` Ingo Schwarze [this message]
2022-06-28 18:18 ` [PATCH 3/3] Wrap manual footer in the "<footer>" tag Anna Vyalkova

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=YsGqrZ5hpqImsAMG@asta-kit.de \
    --to=schwarze@usta.de \
    --cc=cyber@sysrq.in \
    --cc=tech@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).