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.2 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 4300 invoked from network); 21 Jun 2022 12:28:08 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 21 Jun 2022 12:28:08 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 06a107d2 for ; Tue, 21 Jun 2022 07:28:07 -0500 (EST) Received: from sysrq.in (sysrq.in [37.79.202.136]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 676c1f45 for ; Tue, 21 Jun 2022 07:27:58 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sysrq.in; s=sysrq.in; t=1655814473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WxDQCYfhehW4+VFq8+DKK3BghPNjLbG21Xb9BKIps7M=; b=dxjMBBGxERKgCJI+YgBLaUgo5+1xKKzup4SHJFWz/tzgFlKsUxACkfXp1ToC2t3OKbIyB8 OnBZbxiwToPT2bDfFg4+ABCFuUXL+WXPDYgcnJRMMlCoInFy3k9vXhLlfxOUBy2mBVyrdm YkU1TL5ZdOCeTHBqqha0BWc1ot9ndzu/RseGqg1NMlvjXTSjUdjODuGv9MWQp/dD0bs/as lG9+fMG+jlKxrvCW7Vjfff7s9Kf+aWjb5y5tGeXbtr3Kcc7pKscEYidaH8rGiiyPqp+7cO 65leuITe79xKtvuhQyDqDGolXajry6h+dSmDy1HE/cG3DHON6bXvo9vOe/SAsQ== Received: from sysrq.in (localhost [127.0.0.1]) by sysrq.in (OpenSMTPD) with ESMTPSA id bd48f801 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Tue, 21 Jun 2022 12:27:53 +0000 (UTC) From: =?UTF-8?q?Anna=20=E2=80=9CCyberTailor=E2=80=9D?= To: tech@mandoc.bsd.lv Subject: [PATCH 2/8] mdoc_html: Add DPUB-ARIA roles to sections Date: Tue, 21 Jun 2022 17:27:43 +0500 Message-Id: <20220621122749.11417-3-cyber@sysrq.in> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220621122749.11417-1-cyber@sysrq.in> References: <20220621122749.11417-1-cyber@sysrq.in> X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Transfer-Encoding: 8bit --- html.h | 26 ++++++++++++++++++++++++++ mdoc_html.c | 5 +++-- regress/mdoc/Er/tag.out_html | 2 +- regress/mdoc/Rs/paragraph.out_html | 2 +- regress/mdoc/Sh/paragraph.out_html | 2 +- regress/mdoc/Sh/tag.out_html | 8 ++++---- regress/mdoc/Tg/warn.out_html | 2 +- 7 files changed, 37 insertions(+), 10 deletions(-) diff --git a/html.h b/html.h index 5e2adc06..dc4febf2 100644 --- a/html.h +++ b/html.h @@ -74,6 +74,32 @@ enum htmltag { TAG_MAX }; +static const char * const dpubroles[SEC__MAX] = { + NULL, /* SEC_NONE */ + "doc-abstract", /* SEC_NAME */ + "doc-abstract", /* SEC_LIBRARY */ + "doc-part", /* SEC_SYNOPSIS */ + "doc-part", /* SEC_DESCRIPTION */ + "doc-part", /* SEC_CONTEXT */ + "doc-part", /* SEC_IMPLEMENTATION */ + "doc-part", /* SEC_RETURN_VALUES */ + "doc-part", /* SEC_ENVIRONMENT */ + "doc-part", /* SEC_FILES */ + "doc-part", /* SEC_EXIT_STATUS */ + "doc-example", /* SEC_EXAMPLES */ + "doc-part", /* SEC_DIAGNOSTICS */ + "doc-part", /* SEC_COMPATIBILITY */ + "doc-part", /* SEC_ERRORS */ + "doc-part", /* SEC_SEE_ALSO */ + "doc-part", /* SEC_STANDARDS */ + "doc-part", /* SEC_HISTORY */ + "doc-aknowledgments", /* SEC_AUTHORS */ + "doc-part", /* SEC_CAVEATS */ + "doc-part", /* SEC_BUGS */ + "doc-part", /* SEC_SECURITY */ + "doc-part", /* SEC_CUSTOM */ +}; + struct tag { struct tag *next; int refcnt; diff --git a/mdoc_html.c b/mdoc_html.c index d85df753..31cfaac2 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -525,7 +525,8 @@ mdoc_sh_pre(MDOC_ARGS) if ((h->oflags & HTML_TOC) == 0 || h->flags & HTML_TOCDONE || n->sec <= SEC_SYNOPSIS) { - print_otag(h, TAG_SECTION, "c", "Sh"); + print_otag(h, TAG_SECTION, "cr", + "Sh", dpubroles[n->sec]); break; } h->flags |= HTML_TOCDONE; @@ -570,7 +571,7 @@ mdoc_sh_pre(MDOC_ARGS) } print_tagq(h, t); print_tagq(h, tnav); - print_otag(h, TAG_SECTION, "c", "Sh"); + print_otag(h, TAG_SECTION, "cr", "Sh", dpubroles[n->sec]); break; case ROFFT_HEAD: print_otag_id(h, TAG_H1, "Sh", n); diff --git a/regress/mdoc/Er/tag.out_html b/regress/mdoc/Er/tag.out_html index 80daa28b..276bf29b 100644 --- a/regress/mdoc/Er/tag.out_html +++ b/regress/mdoc/Er/tag.out_html @@ -4,7 +4,7 @@ -
+

[]
diff --git a/regress/mdoc/Rs/paragraph.out_html b/regress/mdoc/Rs/paragraph.out_html index bfb0a724..9c197182 100644 --- a/regress/mdoc/Rs/paragraph.out_html +++ b/regress/mdoc/Rs/paragraph.out_html @@ -4,7 +4,7 @@

in a paragraph: another author, another book.

-
+

initial reference:

diff --git a/regress/mdoc/Sh/paragraph.out_html b/regress/mdoc/Sh/paragraph.out_html index 82ede5be..604153cd 100644 --- a/regress/mdoc/Sh/paragraph.out_html +++ b/regress/mdoc/Sh/paragraph.out_html @@ -5,5 +5,5 @@

subsection paragraph

-
+

diff --git a/regress/mdoc/Sh/tag.out_html b/regress/mdoc/Sh/tag.out_html index 0dd39398..88f65803 100644 --- a/regress/mdoc/Sh/tag.out_html +++ b/regress/mdoc/Sh/tag.out_html @@ -1,11 +1,11 @@

Text in the subsection.

-
+

Text in duplicate description section.

-
+

Text introducing examples.

@@ -17,11 +17,11 @@

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..7c7d7943 100644 --- a/regress/mdoc/Tg/warn.out_html +++ b/regress/mdoc/Tg/warn.out_html @@ -6,6 +6,6 @@

subtext

-
+

example text

-- 2.35.1 -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv