From bc6d8c884c63e49aafa7894399d3d7060108b4ec Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 1 Apr 2020 20:21:08 +0000 Subject: Just like we are already doing it in HTML output, automatically tag section and subsection headers in terminal output, too. Even though admittedly, commands like "/SEE" and "/ Subsec" work, too, there is no downside, and besides, with the recent improvements in the tagging framework, implementation cost is negligible. --- regress/mdoc/Sh/Makefile | 5 +++-- regress/mdoc/Sh/tag.in | 10 ++++++++-- regress/mdoc/Sh/tag.out_ascii | 11 ++++++++++- regress/mdoc/Sh/tag.out_html | 14 ++++++++++++++ regress/mdoc/Sh/tag.out_lint | 3 +++ regress/mdoc/Sh/tag.out_markdown | 14 +++++++++++++- regress/mdoc/Sh/tag.out_tag | 7 +++++++ 7 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 regress/mdoc/Sh/tag.out_lint create mode 100644 regress/mdoc/Sh/tag.out_tag (limited to 'regress/mdoc/Sh') diff --git a/regress/mdoc/Sh/Makefile b/regress/mdoc/Sh/Makefile index 4b37bb2a..ea21e502 100644 --- a/regress/mdoc/Sh/Makefile +++ b/regress/mdoc/Sh/Makefile @@ -1,11 +1,12 @@ -# $OpenBSD: Makefile,v 1.13 2020/02/27 21:38:27 schwarze Exp $ +# $OpenBSD: Makefile,v 1.14 2020/04/01 20:10:18 schwarze Exp $ REGRESS_TARGETS = badNAME before empty emptyNAME first nohead order REGRESS_TARGETS += orderNAME paragraph parbefore parborder punctNAME REGRESS_TARGETS += subbefore tag transp LINT_TARGETS = badNAME before empty emptyNAME first nohead order -LINT_TARGETS += orderNAME parbefore parborder punctNAME subbefore +LINT_TARGETS += orderNAME parbefore parborder punctNAME subbefore tag HTML_TARGETS = paragraph tag +TAG_TARGETS = tag # groff-1.22.3 defects: # - .Pp before .Sh NAME causes a blank line before the header line diff --git a/regress/mdoc/Sh/tag.in b/regress/mdoc/Sh/tag.in index 0e0e5fef..da8a884a 100644 --- a/regress/mdoc/Sh/tag.in +++ b/regress/mdoc/Sh/tag.in @@ -1,5 +1,5 @@ -.\" $OpenBSD: tag.in,v 1.1 2020/02/27 21:38:27 schwarze Exp $ -.Dd $Mdocdate: February 27 2020 $ +.\" $OpenBSD: tag.in,v 1.2 2020/04/01 20:10:18 schwarze Exp $ +.Dd $Mdocdate: April 1 2020 $ .Dt SH-TAG 1 .Os .Sh NAME @@ -11,11 +11,17 @@ Text in the description. BEGINTEST .Pp Text in the subsection. +.Sh DESCRIPTION +Text in duplicate description section. .Tg examples .Sh EXAMPLES Text introducing examples. .Tg example .Ss Subsection Example text. +.Sh "\& WEIRD SECTION " +Text in weird section. +.Sh \ \& +Text in section with empty header. .Pp ENDTEST diff --git a/regress/mdoc/Sh/tag.out_ascii b/regress/mdoc/Sh/tag.out_ascii index df0ab050..309cb559 100644 --- a/regress/mdoc/Sh/tag.out_ascii +++ b/regress/mdoc/Sh/tag.out_ascii @@ -11,12 +11,21 @@ DDEESSCCRRIIPPTTIIOONN Text in the subsection. +DDEESSCCRRIIPPTTIIOONN + Text in duplicate description section. + EEXXAAMMPPLLEESS Text introducing examples. SSuubbsseeccttiioonn Example text. + WWEEIIRRDD SSEECCTTIIOONN + Text in weird section. + + + Text in section with empty header. + ENDTEST -OpenBSD February 27, 2020 OpenBSD +OpenBSD April 1, 2020 OpenBSD diff --git a/regress/mdoc/Sh/tag.out_html b/regress/mdoc/Sh/tag.out_html index 9722aa8c..49c45fdb 100644 --- a/regress/mdoc/Sh/tag.out_html +++ b/regress/mdoc/Sh/tag.out_html @@ -2,8 +2,22 @@
+

+

Text in duplicate description section.

+
+

Text introducing examples.

Example text.

+
+
+
+

+

Text in weird section.

+
+
+

 

+

Text in section with empty header.

diff --git a/regress/mdoc/Sh/tag.out_lint b/regress/mdoc/Sh/tag.out_lint new file mode 100644 index 00000000..cfb1dfad --- /dev/null +++ b/regress/mdoc/Sh/tag.out_lint @@ -0,0 +1,3 @@ +mandoc: tag.in:14:2: WARNING: duplicate section title: Sh DESCRIPTION +mandoc: tag.in:22:7: WARNING: tab in filled text +mandoc: tag.in:22:22: WARNING: tab in filled text diff --git a/regress/mdoc/Sh/tag.out_markdown b/regress/mdoc/Sh/tag.out_markdown index 2813f8f0..75a1e58e 100644 --- a/regress/mdoc/Sh/tag.out_markdown +++ b/regress/mdoc/Sh/tag.out_markdown @@ -14,6 +14,10 @@ BEGINTEST Text in the subsection. +# DESCRIPTION + +Text in duplicate description section. + # EXAMPLES Text introducing examples. @@ -22,6 +26,14 @@ Text introducing examples. Example text. +# WEIRD SECTION + +Text in weird section. + +#   + +Text in section with empty header. + ENDTEST -OpenBSD - February 27, 2020 +OpenBSD - April 1, 2020 diff --git a/regress/mdoc/Sh/tag.out_tag b/regress/mdoc/Sh/tag.out_tag new file mode 100644 index 00000000..04b11882 --- /dev/null +++ b/regress/mdoc/Sh/tag.out_tag @@ -0,0 +1,7 @@ +NAME 3 +DESCRIPTION 6 +Subsection 9 +DESCRIPTION 14 +examples 17 +example 20 +WEIRD_SECTION 23 -- cgit v1.2.3-56-ge451