aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2022-06-24 11:15:53 +0000
committerIngo Schwarze <schwarze@openbsd.org>2022-06-24 11:15:53 +0000
commit775d26d8d971fc94e1220bd3c8f87e4a1409a2ca (patch)
tree32a9a794f2256527eabce00439cb226c70a6e996 /html.c
parent57d5a8a3f3e52ca15b81371ea3b38c3124a45ec4 (diff)
downloadmandoc-775d26d8d971fc94e1220bd3c8f87e4a1409a2ca.tar.gz
mandoc-775d26d8d971fc94e1220bd3c8f87e4a1409a2ca.tar.zst
mandoc-775d26d8d971fc94e1220bd3c8f87e4a1409a2ca.zip
Improve accessibility of -T html -O toc output by using the <nav> element
in the DPUB-ARIA doc-toc role. Patch from Anna Vyalkova <cyber at sysrq dot in> slightly tweaked by me. This is hopefully the start of a collaboration to improve accessibility of Unix manual pages using the WAI-ARIA, HTML-ARIA, and DPUB-ARIA standards. Progress appears to be possible without changing *anything* with respect to the way manual pages are written. Instead, it seems sufficient to properly translate semantic cues already implied by existing mdoc(7) markup into the appropriate HTML elements and ARIA attributes. Overall, the total length of HTML output is likely to increase slightly, but not much.
Diffstat (limited to 'html.c')
-rw-r--r--html.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/html.c b/html.c
index 71c9c711..4c12b7b6 100644
--- a/html.c
+++ b/html.c
@@ -1,4 +1,4 @@
-/* $Id: html.c,v 1.275 2021/09/09 14:47:24 schwarze Exp $ */
+/* $Id: html.c,v 1.276 2022/06/24 11:15:53 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015, 2017-2021 Ingo Schwarze <schwarze@openbsd.org>
@@ -69,6 +69,7 @@ static const struct htmldata htmltags[TAG_MAX] = {
{"body", HTML_NLALL},
{"div", HTML_NLAROUND},
{"section", HTML_NLALL},
+ {"nav", HTML_NLALL},
{"table", HTML_NLALL | HTML_INDENT},
{"tr", HTML_NLALL | HTML_INDENT},
{"td", HTML_NLAROUND},
@@ -708,6 +709,9 @@ print_otag(struct html *h, enum htmltag tag, const char *fmt, ...)
case 'i':
attr = "id";
break;
+ case 'r':
+ attr = "role";
+ break;
case '?':
attr = arg1;
arg1 = va_arg(ap, char *);