source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: Finally, represent the man(7) .PP and .HP macros by the natural
@ 2019-01-06  4:55 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2019-01-06  4:55 UTC (permalink / raw)
  To: source

Log Message:
-----------
Finally, represent the man(7) .PP and .HP macros by the natural
choice, which is the <p> HTML element.  On top of the previous
fill-mode improvements, the key to making this possible is to
automatically close the <p> when required: before headers, subsequent
paragraphs, lists, indented blocks, synopsis blocks, tbl(7) blocks,
and before blocks using no-fill mode.

In man(7) documents, represent the .sp request by a blank line in
no-fill mode and in the same way as .PP in fill mode.

Modified Files:
--------------
    mandoc:
        html.c
        html.h
        man_html.c
        roff_html.c
        tbl_html.c
    mandoc/regress/man/HP:
        Makefile
        literal.in
        literal.out_ascii
    mandoc/regress/man/IP:
        Makefile
        literal.in
        literal.out_ascii
    mandoc/regress/man/RS:
        Makefile
    mandoc/regress/man/SH:
        Makefile
    mandoc/regress/man/SS:
        Makefile
    mandoc/regress/man/TP:
        Makefile
        literal.in
        literal.out_ascii
    mandoc/regress/roff/sp:
        Makefile

Added Files:
-----------
    mandoc/regress/man/HP:
        literal.out_html
    mandoc/regress/man/IP:
        literal.out_html
    mandoc/regress/man/RS:
        paragraph.in
        paragraph.out_ascii
        paragraph.out_html
    mandoc/regress/man/SH:
        paragraph.in
        paragraph.out_ascii
        paragraph.out_html
    mandoc/regress/man/SS:
        paragraph.in
        paragraph.out_ascii
        paragraph.out_html
    mandoc/regress/man/TP:
        literal.out_html
    mandoc/regress/roff/sp:
        fill-man.in
        fill-man.out_ascii
        fill-man.out_html

Revision Data
-------------
--- /dev/null
+++ regress/man/SS/paragraph.out_ascii
@@ -0,0 +1,23 @@
+SS-PARAGRAPH(1)             General Commands Manual            SS-PARAGRAPH(1)
+
+
+
+N\bNA\bAM\bME\bE
+       SS-paragraph - interaction of subsection headers with paragraphs
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+       BEGINTEST
+
+   F\bFi\bir\brs\bst\bt s\bsu\bub\bbs\bse\bec\bct\bti\bio\bon\bn
+       This text immediately follows a subsection header.
+
+       This is a paragraph.
+
+   S\bSe\bec\bco\bon\bnd\bd s\bsu\bub\bbs\bse\bec\bct\bti\bio\bon\bn
+       ENDTEST
+
+       end of file
+
+
+
+OpenBSD                         January 6, 2019                SS-PARAGRAPH(1)
--- /dev/null
+++ regress/man/SS/paragraph.out_html
@@ -0,0 +1,8 @@
+BEGINTEST
+<h2 class="Ss" title="Ss" id="First_subsection"><a class="permalink" href="#First_subsection">First
+  subsection</a></h2>
+This text immediately follows a subsection header.
+<p class="Pp">This is a paragraph.</p>
+<h2 class="Ss" title="Ss" id="Second_subsection"><a class="permalink" href="#Second_subsection">Second
+  subsection</a></h2>
+ENDTEST
--- /dev/null
+++ regress/man/SS/paragraph.in
@@ -0,0 +1,17 @@
+.\" $OpenBSD: paragraph.in,v 1.1 2019/01/06 04:41:15 schwarze Exp $
+.TH SS-PARAGRAPH 1 "January 6, 2019"
+.SH NAME
+SS-paragraph \- interaction of subsection headers with paragraphs
+.SH DESCRIPTION
+BEGINTEST
+.SS First subsection
+This text
+immediately follows
+a subsection header.
+.PP
+This is
+a paragraph.
+.SS Second subsection
+ENDTEST
+.PP
+end of file
Index: Makefile
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/man/SS/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lregress/man/SS/Makefile -Lregress/man/SS/Makefile -u -p -r1.2 -r1.3
--- regress/man/SS/Makefile
+++ regress/man/SS/Makefile
@@ -1,7 +1,8 @@
-# $OpenBSD: Makefile,v 1.2 2015/04/04 18:52:12 schwarze Exp $
+# $OpenBSD: Makefile,v 1.4 2019/01/06 04:41:15 schwarze Exp $
 
-REGRESS_TARGETS	= broken broken_eline longarg noarg
+REGRESS_TARGETS	= broken broken_eline longarg noarg paragraph
 LINT_TARGETS	= broken broken_eline noarg
+HTML_TARGETS	= paragraph
 
 # groff-1.22.3 defects:
 # - .SS without args just before EOF causes two additional blank lines.
Index: man_html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/man_html.c,v
retrieving revision 1.165
retrieving revision 1.166
diff -Lman_html.c -Lman_html.c -u -p -r1.165 -r1.166
--- man_html.c
+++ man_html.c
@@ -42,14 +42,11 @@ struct	man_html_act {
 	int		(*post)(MAN_ARGS);
 };
 
-static	void		  print_bvspace(struct html *,
-				const struct roff_node *);
 static	void		  print_man_head(const struct roff_meta *,
 				struct html *);
 static	void		  print_man_nodelist(MAN_ARGS);
 static	void		  print_man_node(MAN_ARGS);
 static	int		  man_B_pre(MAN_ARGS);
-static	int		  man_HP_pre(MAN_ARGS);
 static	int		  man_IP_pre(MAN_ARGS);
 static	int		  man_I_pre(MAN_ARGS);
 static	int		  man_OP_pre(MAN_ARGS);
@@ -57,7 +54,6 @@ static	int		  man_PP_pre(MAN_ARGS);
 static	int		  man_RS_pre(MAN_ARGS);
 static	int		  man_SH_pre(MAN_ARGS);
 static	int		  man_SM_pre(MAN_ARGS);
-static	int		  man_SS_pre(MAN_ARGS);
 static	int		  man_SY_pre(MAN_ARGS);
 static	int		  man_UR_pre(MAN_ARGS);
 static	int		  man_abort_pre(MAN_ARGS);
@@ -72,14 +68,14 @@ static	void		  man_root_pre(const struct
 static	const struct man_html_act man_html_acts[MAN_MAX - MAN_TH] = {
 	{ NULL, NULL }, /* TH */
 	{ man_SH_pre, NULL }, /* SH */
-	{ man_SS_pre, NULL }, /* SS */
+	{ man_SH_pre, NULL }, /* SS */
 	{ man_IP_pre, NULL }, /* TP */
 	{ man_IP_pre, NULL }, /* TQ */
 	{ man_abort_pre, NULL }, /* LP */
 	{ man_PP_pre, NULL }, /* PP */
 	{ man_abort_pre, NULL }, /* P */
 	{ man_IP_pre, NULL }, /* IP */
-	{ man_HP_pre, NULL }, /* HP */
+	{ man_PP_pre, NULL }, /* HP */
 	{ man_SM_pre, NULL }, /* SM */
 	{ man_SM_pre, NULL }, /* SB */
 	{ man_alt_pre, NULL }, /* BI */
@@ -110,27 +106,6 @@ static	const struct man_html_act man_htm
 };
 
 
-/*
- * Printing leading vertical space before a block.
- * This is used for the paragraph macros.
- * The rules are pretty simple, since there's very little nesting going
- * on here.  Basically, if we're the first within another block (SS/SH),
- * then don't emit vertical space.  If we are (RS), then do.  If not the
- * first, print it.
- */
-static void
-print_bvspace(struct html *h, const struct roff_node *n)
-{
-	if (n->body != NULL && n->body->child != NULL &&
-	    n->body->child->type == ROFFT_TBL)
-		return;
-
-	if (n->prev == NULL && n->parent->tok != MAN_RS)
-		return;
-
-	print_paragraph(h);
-}
-
 void
 html_man(void *arg, const struct roff_meta *man)
 {
@@ -239,7 +214,8 @@ print_man_node(MAN_ARGS)
 		t = h->tag;
 		if (n->tok < ROFF_MAX) {
 			roff_html_pre(h, n);
-			print_stagq(h, t);
+			if (n->tok != ROFF_sp)
+				print_stagq(h, t);
 			return;
 		}
 
@@ -315,11 +291,23 @@ man_SH_pre(MAN_ARGS)
 {
 	char	*id;
 
-	if (n->type == ROFFT_HEAD) {
+	switch (n->type) {
+	case ROFFT_BLOCK:
+		html_close_paragraph(h);
+		break;
+	case ROFFT_HEAD:
 		id = html_make_id(n, 1);
-		print_otag(h, TAG_H1, "cTi", "Sh", id);
+		if (n->tok == MAN_SH)
+			print_otag(h, TAG_H1, "cTi", "Sh", id);
+		else
+			print_otag(h, TAG_H2, "cTi", "Ss", id);
 		if (id != NULL)
 			print_otag(h, TAG_A, "chR", "permalink", id);
+		break;
+	case ROFFT_BODY:
+		break;
+	default:
+		abort();
 	}
 	return 1;
 }
@@ -380,27 +368,23 @@ man_SM_pre(MAN_ARGS)
 }
 
 static int
-man_SS_pre(MAN_ARGS)
-{
-	char	*id;
-
-	if (n->type == ROFFT_HEAD) {
-		id = html_make_id(n, 1);
-		print_otag(h, TAG_H2, "cTi", "Ss", id);
-		if (id != NULL)
-			print_otag(h, TAG_A, "chR", "permalink", id);
-	}
-	return 1;
-}
-
-static int
 man_PP_pre(MAN_ARGS)
 {
-	if (n->type == ROFFT_HEAD)
+	switch (n->type) {
+	case ROFFT_BLOCK:
+		html_close_paragraph(h);
+		break;
+	case ROFFT_HEAD:
 		return 0;
-	else if (n->type == ROFFT_BLOCK)
-		print_bvspace(h, n);
-
+	case ROFFT_BODY:
+		if (n->child != NULL &&
+		    (n->child->flags & NODE_NOFILL) == 0)
+			print_otag(h, TAG_P, "c",
+			    n->tok == MAN_PP ? "Pp" : "Pp HP");
+		break;
+	default:
+		abort();
+	}
 	return 1;
 }
 
@@ -409,16 +393,21 @@ man_IP_pre(MAN_ARGS)
 {
 	const struct roff_node	*nn;
 
-	if (n->type == ROFFT_BODY) {
-		print_otag(h, TAG_DD, "");
-		return 1;
-	} else if (n->type != ROFFT_HEAD) {
+	switch (n->type) {
+	case ROFFT_BLOCK:
+		html_close_paragraph(h);
 		print_otag(h, TAG_DL, "c", "Bl-tag");
 		return 1;
+	case ROFFT_HEAD:
+		print_otag(h, TAG_DT, "");
+		break;
+	case ROFFT_BODY:
+		print_otag(h, TAG_DD, "");
+		return 1;
+	default:
+		abort();
 	}
 
-	print_otag(h, TAG_DT, "");
-
 	switch(n->tok) {
 	case MAN_IP:  /* Only print the first header element. */
 		if (n->child != NULL)
@@ -441,19 +430,6 @@ man_IP_pre(MAN_ARGS)
 }
 
 static int
-man_HP_pre(MAN_ARGS)
-{
-	if (n->type == ROFFT_HEAD)
-		return 0;
-
-	if (n->type == ROFFT_BLOCK) {
-		print_bvspace(h, n);
-		print_otag(h, TAG_DIV, "c", "HP");
-	}
-	return 1;
-}
-
-static int
 man_OP_pre(MAN_ARGS)
 {
 	struct tag	*tt;
@@ -510,10 +486,18 @@ man_ign_pre(MAN_ARGS)
 static int
 man_RS_pre(MAN_ARGS)
 {
-	if (n->type == ROFFT_HEAD)
+	switch (n->type) {
+	case ROFFT_BLOCK:
+		html_close_paragraph(h);
+		break;
+	case ROFFT_HEAD:
 		return 0;
-	if (n->type == ROFFT_BLOCK)
+	case ROFFT_BODY:
 		print_otag(h, TAG_DIV, "c", "Bd-indent");
+		break;
+	default:
+		abort();
+	}
 	return 1;
 }
 
@@ -522,6 +506,7 @@ man_SY_pre(MAN_ARGS)
 {
 	switch (n->type) {
 	case ROFFT_BLOCK:
+		html_close_paragraph(h);
 		print_otag(h, TAG_TABLE, "c", "Nm");
 		print_otag(h, TAG_TR, "");
 		break;
Index: html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/html.c,v
retrieving revision 1.248
retrieving revision 1.249
diff -Lhtml.c -Lhtml.c -u -p -r1.248 -r1.249
--- html.c
+++ html.c
@@ -1,7 +1,7 @@
 /*	$Id$ */
 /*
  * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2011-2015, 2017-2019 Ingo Schwarze <schwarze@openbsd.org>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -78,6 +78,7 @@ static	const struct htmldata htmltags[TA
 	{"dl",		HTML_NLALL | HTML_INDENT},
 	{"dt",		HTML_NLAROUND},
 	{"dd",		HTML_NLAROUND | HTML_INDENT},
+	{"p",		HTML_NLAROUND | HTML_INDENT},
 	{"pre",		HTML_NLALL | HTML_NOINDENT},
 	{"var",		0},
 	{"cite",	0},
@@ -265,6 +266,19 @@ print_metaf(struct html *h, enum mandoc_
 	}
 }
 
+void
+html_close_paragraph(struct html *h)
+{
+	struct tag	*t;
+
+	for (t = h->tag; t != NULL; t = t->next) {
+		if (t->tag == TAG_P) {
+			print_tagq(h, t);
+			break;
+		}
+	}
+}
+
 /*
  * ROFF_nf switches to no-fill mode, ROFF_fi to fill mode.
  * TOKEN_NONE does not switch.  The old mode is returned.
@@ -287,6 +301,7 @@ html_fillmode(struct html *h, enum roff_
 			print_tagq(h, t);
 			break;
 		case ROFF_nf:
+			html_close_paragraph(h);
 			print_otag(h, TAG_PRE, "");
 			break;
 		case TOKEN_NONE:
Index: html.h
===================================================================
RCS file: /home/cvs/mandoc/mandoc/html.h,v
retrieving revision 1.98
retrieving revision 1.99
diff -Lhtml.h -Lhtml.h -u -p -r1.98 -r1.99
--- html.h
+++ html.h
@@ -1,7 +1,7 @@
 /*	$Id$ */
 /*
  * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2017, 2018, 2019 Ingo Schwarze <schwarze@openbsd.org>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -39,6 +39,7 @@ enum	htmltag {
 	TAG_DL,
 	TAG_DT,
 	TAG_DD,
+	TAG_P,
 	TAG_PRE,
 	TAG_VAR,
 	TAG_CITE,
@@ -135,5 +136,6 @@ void		  print_eqn(struct html *, const s
 void		  print_paragraph(struct html *);
 void		  print_endline(struct html *);
 
+void		  html_close_paragraph(struct html *);
 enum roff_tok	  html_fillmode(struct html *, enum roff_tok);
 char		 *html_make_id(const struct roff_node *, int);
Index: tbl_html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/tbl_html.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -Ltbl_html.c -Ltbl_html.c -u -p -r1.31 -r1.32
--- tbl_html.c
+++ tbl_html.c
@@ -80,6 +80,7 @@ html_tbl_sulen(const struct roffsu *su, 
 static void
 html_tblopen(struct html *h, const struct tbl_span *sp)
 {
+	html_close_paragraph(h);
 	if (h->tbl.cols == NULL) {
 		h->tbl.len = html_tbl_len;
 		h->tbl.slen = html_tbl_strlen;
Index: roff_html.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/roff_html.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -Lroff_html.c -Lroff_html.c -u -p -r1.17 -r1.18
--- roff_html.c
+++ roff_html.c
@@ -107,5 +107,11 @@ roff_html_pre_nf(ROFF_HTML_ARGS)
 static void
 roff_html_pre_sp(ROFF_HTML_ARGS)
 {
-	print_paragraph(h);
+	if (html_fillmode(h, TOKEN_NONE) == ROFF_nf) {
+		h->col++;
+		print_endline(h);
+	} else if (n->parent->tok >= MAN_TH)
+		print_otag(h, TAG_P, "c", "Pp");
+	else
+		print_paragraph(h);
 }
Index: literal.in
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/man/HP/literal.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lregress/man/HP/literal.in -Lregress/man/HP/literal.in -u -p -r1.2 -r1.3
--- regress/man/HP/literal.in
+++ regress/man/HP/literal.in
@@ -1,27 +1,32 @@
-.\" $OpenBSD: literal.in,v 1.2 2017/07/04 14:53:23 schwarze Exp $
-.TH HP-LITERAL 1 "January 4, 2011"
+.\" $OpenBSD: literal.in,v 1.3 2019/01/06 04:41:15 schwarze Exp $
+.TH HP-LITERAL 1 "January 6, 2019"
 .SH NAME
 HP-literal \- hanged paragraphs in literal context
 .SH DESCRIPTION
-regular
-text
+BEGINTEST
+before hanged paragraph
 .HP 10n
 tag
 indented
 text
 .PP
 regular
-text
+paragraph
 .nf
 literal
 text
 .HP 10n
 tag
-indented
-text
+literal
+hanged
+paragraph
 .PP
 literal
-text
+paragraph
 .fi
 regular
 text
+.br
+ENDTEST
+.br
+end of file
Index: literal.out_ascii
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/man/HP/literal.out_ascii,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lregress/man/HP/literal.out_ascii -Lregress/man/HP/literal.out_ascii -u -p -r1.1 -r1.2
--- regress/man/HP/literal.out_ascii
+++ regress/man/HP/literal.out_ascii
@@ -6,22 +6,25 @@ N\bNA\bAM\bME\bE
        HP-literal - hanged paragraphs in literal context
 
 D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
-       regular text
+       BEGINTEST before hanged paragraph
 
        tag indented text
 
-       regular text
+       regular paragraph
        literal
        text
 
        tag
-                 indented
-                 text
+                 literal
+                 hanged
+                 paragraph
 
        literal
-       text
+       paragraph
        regular text
+       ENDTEST
+       end of file
 
 
 
-OpenBSD                         January 4, 2011                  HP-LITERAL(1)
+OpenBSD                         January 6, 2019                  HP-LITERAL(1)
--- /dev/null
+++ regress/man/HP/literal.out_html
@@ -0,0 +1,20 @@
+BEGINTEST before hanged paragraph
+<p class="Pp HP">tag indented text</p>
+<p class="Pp">regular paragraph</p>
+<pre>
+literal
+text
+</pre>
+<pre>
+tag
+literal
+hanged
+paragraph
+</pre>
+<pre>
+literal
+paragraph
+</pre>
+regular text
+<br/>
+ENDTEST
Index: Makefile
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/man/HP/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lregress/man/HP/Makefile -Lregress/man/HP/Makefile -u -p -r1.1 -r1.2
--- regress/man/HP/Makefile
+++ regress/man/HP/Makefile
@@ -1,5 +1,6 @@
-# $OpenBSD: Makefile,v 1.2 2014/04/08 04:45:50 schwarze Exp $
+# $OpenBSD: Makefile,v 1.3 2019/01/06 04:41:15 schwarze Exp $
 
 REGRESS_TARGETS = break literal macrotag manyargs spacing
+HTML_TARGETS	= literal
 
 .include <bsd.regress.mk>
--- /dev/null
+++ regress/man/IP/literal.out_html
@@ -0,0 +1,65 @@
+BEGINTEST before indentation
+<dl class="Bl-tag">
+  <dt>tag</dt>
+  <dd>indented regular text</dd>
+</dl>
+<p class="Pp">new regular paragraph</p>
+<pre>
+literal
+text
+</pre>
+<dl class="Bl-tag">
+  <dt>tag</dt>
+  <dd>
+    <pre>
+indented
+literal
+text
+    </pre>
+  </dd>
+</dl>
+<pre>
+new
+literal
+paragraph
+</pre>
+regular text
+<h2 class="Ss" title="Ss" id="literal_into_indented_paragraph"><a class="permalink" href="#literal_into_indented_paragraph">literal
+  into indented paragraph</a></h2>
+regular text
+<pre>
+literal
+text
+</pre>
+<dl class="Bl-tag">
+  <dt>tag</dt>
+  <dd>
+    <pre>
+indented
+literal
+text
+    </pre>
+    indented regular text</dd>
+</dl>
+<p class="Pp">new regular paragraph</p>
+<h2 class="Ss" title="Ss" id="literal_out_of_indented_paragraph"><a class="permalink" href="#literal_out_of_indented_paragraph">literal
+  out of indented paragraph</a></h2>
+regular text
+<dl class="Bl-tag">
+  <dt>tag</dt>
+  <dd>indented regular text
+    <pre>
+indented
+literal
+text
+    </pre>
+  </dd>
+</dl>
+<pre>
+new
+literal
+paragraph
+</pre>
+regular text
+<br/>
+ENDTEST
Index: Makefile
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/man/IP/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lregress/man/IP/Makefile -Lregress/man/IP/Makefile -u -p -r1.1 -r1.2
--- regress/man/IP/Makefile
+++ regress/man/IP/Makefile
@@ -1,6 +1,7 @@
-# $OpenBSD: Makefile,v 1.8 2014/07/02 05:51:49 schwarze Exp $
+# $OpenBSD: Makefile,v 1.9 2019/01/06 04:41:15 schwarze Exp $
 
 REGRESS_TARGETS = empty literal longhead manyargs spacing width
 LINT_TARGETS	= empty
+HTML_TARGETS	= literal
 
 .include <bsd.regress.mk>
Index: literal.out_ascii
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/man/IP/literal.out_ascii,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lregress/man/IP/literal.out_ascii -Lregress/man/IP/literal.out_ascii -u -p -r1.2 -r1.3
--- regress/man/IP/literal.out_ascii
+++ regress/man/IP/literal.out_ascii
@@ -6,7 +6,7 @@ N\bNA\bAM\bME\bE
        IP-literal - indented paragraphs in literal context
 
 D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
-       regular text
+       BEGINTEST before indentation
 
        tag       indented regular text
 
@@ -47,7 +47,9 @@ D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
        literal
        paragraph
        regular text
+       ENDTEST
+       end of file
 
 
 
-OpenBSD                         January 4, 2011                  IP-LITERAL(1)
+OpenBSD                         January 6, 2019                  IP-LITERAL(1)
Index: literal.in
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/man/IP/literal.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lregress/man/IP/literal.in -Lregress/man/IP/literal.in -u -p -r1.3 -r1.4
--- regress/man/IP/literal.in
+++ regress/man/IP/literal.in
@@ -1,10 +1,10 @@
-.\" $OpenBSD: literal.in,v 1.6 2017/07/04 14:53:23 schwarze Exp $
-.TH IP-LITERAL 1 "January 4, 2011"
+.\" $OpenBSD: literal.in,v 1.7 2019/01/06 04:41:15 schwarze Exp $
+.TH IP-LITERAL 1 "January 6, 2019"
 .SH NAME
 IP-literal \- indented paragraphs in literal context
 .SH DESCRIPTION
-regular
-text
+BEGINTEST
+before indentation
 .IP tag 10n
 indented
 regular
@@ -63,3 +63,7 @@ paragraph
 .fi
 regular
 text
+.br
+ENDTEST
+.br
+end of file
--- /dev/null
+++ regress/man/RS/paragraph.out_ascii
@@ -0,0 +1,21 @@
+RS-PARAGRAPH(1)             General Commands Manual            RS-PARAGRAPH(1)
+
+
+
+N\bNA\bAM\bME\bE
+       RS-paragraph - interaction between regular and indented paragraphs
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+       BEGINTEST before paragraph
+
+       regular paragraph
+              indented paragraph
+
+              nested paragraph
+       regular text after display
+       ENDTEST
+       end of file
+
+
+
+OpenBSD                         January 6, 2019                RS-PARAGRAPH(1)
--- /dev/null
+++ regress/man/RS/paragraph.out_html
@@ -0,0 +1,8 @@
+BEGINTEST before paragraph
+<p class="Pp">regular paragraph</p>
+<div class="Bd-indent">indented paragraph
+<p class="Pp">nested paragraph</p>
+</div>
+regular text after display
+<br/>
+ENDTEST
--- /dev/null
+++ regress/man/RS/paragraph.in
@@ -0,0 +1,23 @@
+.\" $OpenBSD: paragraph.in,v 1.1 2019/01/06 04:41:15 schwarze Exp $
+.TH RS-PARAGRAPH 1 "January 6, 2019"
+.SH NAME
+RS-paragraph \- interaction between regular and indented paragraphs
+.SH DESCRIPTION
+BEGINTEST
+before paragraph
+.PP
+regular
+paragraph
+.RS
+indented
+paragraph
+.PP
+nested
+paragraph
+.RE
+regular text
+after display
+.br
+ENDTEST
+.br
+end of file
Index: Makefile
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/man/RS/Makefile,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lregress/man/RS/Makefile -Lregress/man/RS/Makefile -u -p -r1.3 -r1.4
--- regress/man/RS/Makefile
+++ regress/man/RS/Makefile
@@ -1,8 +1,8 @@
-# $OpenBSD: Makefile,v 1.13 2019/01/05 20:00:33 schwarze Exp $
+# $OpenBSD: Makefile,v 1.14 2019/01/06 04:41:15 schwarze Exp $
 
 REGRESS_TARGETS	 = an-margin breaking broken empty literal lonelyRE
-REGRESS_TARGETS	+= nested noRE nowidth REarg width
+REGRESS_TARGETS	+= nested noRE nowidth paragraph REarg width
 LINT_TARGETS	 = empty lonelyRE noRE REarg
-HTML_TARGETS	 = literal
+HTML_TARGETS	 = literal paragraph
 
 .include <bsd.regress.mk>
--- /dev/null
+++ regress/man/SH/paragraph.out_ascii
@@ -0,0 +1,23 @@
+SH-PARAGRAPH(1)             General Commands Manual            SH-PARAGRAPH(1)
+
+
+
+N\bNA\bAM\bME\bE
+       SH-paragraph - interaction of section headers with paragraphs
+
+S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
+       BEGINTEST
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+       This text immediately follows a section header.
+
+       This is a paragraph.
+
+E\bEX\bXA\bAM\bMP\bPL\bLE\bES\bS
+       ENDTEST
+
+       end of file
+
+
+
+OpenBSD                         January 6, 2019                SH-PARAGRAPH(1)
Index: Makefile
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/man/SH/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lregress/man/SH/Makefile -Lregress/man/SH/Makefile -u -p -r1.2 -r1.3
--- regress/man/SH/Makefile
+++ regress/man/SH/Makefile
@@ -1,7 +1,8 @@
-# $OpenBSD: Makefile,v 1.4 2015/04/04 18:52:12 schwarze Exp $
+# $OpenBSD: Makefile,v 1.6 2019/01/06 04:41:15 schwarze Exp $
 
-REGRESS_TARGETS	= broken broken_eline empty_before longarg noarg
+REGRESS_TARGETS	= broken broken_eline empty_before longarg noarg paragraph
 LINT_TARGETS	= broken broken_eline empty_before noarg
+HTML_TARGETS	= paragraph
 
 # groff-1.22.3 defects:
 # - .SH without args just before EOF causes two additional blank lines.
--- /dev/null
+++ regress/man/SH/paragraph.in
@@ -0,0 +1,17 @@
+.\" $OpenBSD: paragraph.in,v 1.1 2019/01/06 04:41:15 schwarze Exp $
+.TH SH-PARAGRAPH 1 "January 6, 2019"
+.SH NAME
+SH-paragraph \- interaction of section headers with paragraphs
+.SH SYNOPSIS
+BEGINTEST
+.SH DESCRIPTION
+This text
+immediately follows
+a section header.
+.PP
+This is
+a paragraph.
+.SH EXAMPLES
+ENDTEST
+.PP
+end of file
--- /dev/null
+++ regress/man/SH/paragraph.out_html
@@ -0,0 +1,6 @@
+BEGINTEST
+<h1 class="Sh" title="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
+This text immediately follows a section header.
+<p class="Pp">This is a paragraph.</p>
+<h1 class="Sh" title="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
+ENDTEST
Index: literal.out_ascii
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/man/TP/literal.out_ascii,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lregress/man/TP/literal.out_ascii -Lregress/man/TP/literal.out_ascii -u -p -r1.1 -r1.2
--- regress/man/TP/literal.out_ascii
+++ regress/man/TP/literal.out_ascii
@@ -6,21 +6,24 @@ N\bNA\bAM\bME\bE
        TP-literal - indented paragraphs in literal context
 
 D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
-       regular text
+       BEGINTEST before indentation
 
-       tag       indented text
+       tag       regular indented text
 
-       regular text
+       regular paragraph
        literal
        text
 
        tag       indented
+                 literal
                  text
 
        literal
-       text
+       paragraph
        regular text
+       ENDTEST
+       end of file
 
 
 
-OpenBSD                         January 4, 2011                  TP-LITERAL(1)
+OpenBSD                         January 6, 2019                  TP-LITERAL(1)
Index: Makefile
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/man/TP/Makefile,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lregress/man/TP/Makefile -Lregress/man/TP/Makefile -u -p -r1.3 -r1.4
--- regress/man/TP/Makefile
+++ regress/man/TP/Makefile
@@ -1,9 +1,9 @@
-# $OpenBSD: Makefile,v 1.12 2015/09/21 13:24:32 schwarze Exp $
+# $OpenBSD: Makefile,v 1.15 2019/01/06 04:41:15 schwarze Exp $
 
 REGRESS_TARGETS	 = badarg broken double eof fill indent literal longhead
 REGRESS_TARGETS	+= macrotag manyargs sameline spacing width
-
 LINT_TARGETS	 = broken double eof
+HTML_TARGETS	 = literal
 
 # groff-1.22.3 defects:
 # - If .TP precedes .RE, the latter does not properly reset indentation.
Index: literal.in
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/man/TP/literal.in,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lregress/man/TP/literal.in -Lregress/man/TP/literal.in -u -p -r1.2 -r1.3
--- regress/man/TP/literal.in
+++ regress/man/TP/literal.in
@@ -1,27 +1,33 @@
-.\" $OpenBSD: literal.in,v 1.3 2017/07/04 14:53:24 schwarze Exp $
-.TH TP-LITERAL 1 "January 4, 2011"
+.\" $OpenBSD: literal.in,v 1.4 2019/01/06 04:41:15 schwarze Exp $
+.TH TP-LITERAL 1 "January 6, 2019"
 .SH NAME
 TP-literal \- indented paragraphs in literal context
 .SH DESCRIPTION
-regular
-text
+BEGINTEST
+before indentation
 .TP 10n
 tag
+regular
 indented
 text
 .PP
 regular
-text
+paragraph
 .nf
 literal
 text
 .TP 10n
 tag
 indented
+literal
 text
 .PP
 literal
-text
+paragraph
 .fi
 regular
 text
+.br
+ENDTEST
+.br
+end of file
--- /dev/null
+++ regress/man/TP/literal.out_html
@@ -0,0 +1,27 @@
+BEGINTEST before indentation
+<dl class="Bl-tag">
+  <dt>tag</dt>
+  <dd>regular indented text</dd>
+</dl>
+<p class="Pp">regular paragraph</p>
+<pre>
+literal
+text
+</pre>
+<dl class="Bl-tag">
+  <dt>tag</dt>
+  <dd>
+    <pre>
+indented
+literal
+text
+    </pre>
+  </dd>
+</dl>
+<pre>
+literal
+paragraph
+</pre>
+regular text
+<br/>
+ENDTEST
--- /dev/null
+++ regress/roff/sp/fill-man.out_ascii
@@ -0,0 +1,21 @@
+SP-FILL-MAN(1)              General Commands Manual             SP-FILL-MAN(1)
+
+
+
+N\bNA\bAM\bME\bE
+       sp-fill-man - interaction of vertical spacing requests with fill modes
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+       BEGINTEST in fill mode:
+
+       switch to no-fill mode:
+       in no-fill mode:
+
+       back to
+       fill mode:
+       ENDTEST
+       end of file
+
+
+
+OpenBSD                         January 6, 2019                 SP-FILL-MAN(1)
Index: Makefile
===================================================================
RCS file: /home/cvs/mandoc/mandoc/regress/roff/sp/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lregress/roff/sp/Makefile -Lregress/roff/sp/Makefile -u -p -r1.1 -r1.2
--- regress/roff/sp/Makefile
+++ regress/roff/sp/Makefile
@@ -1,6 +1,8 @@
-# $OpenBSD: Makefile,v 1.5 2015/02/06 09:38:22 schwarze Exp $
+# $OpenBSD: Makefile,v 1.6 2019/01/06 04:41:15 schwarze Exp $
 
-REGRESS_TARGETS	= badargs-man badargs-mdoc negative scaling-man scaling-mdoc
-LINT_TARGETS	= badargs-man
+REGRESS_TARGETS	 = badargs-man badargs-mdoc fill-man
+REGRESS_TARGETS	+= negative scaling-man scaling-mdoc
+LINT_TARGETS	 = badargs-man
+HTML_TARGETS	 = fill-man
 
 .include <bsd.regress.mk>
--- /dev/null
+++ regress/roff/sp/fill-man.out_html
@@ -0,0 +1,9 @@
+BEGINTEST in fill mode:
+<p class="Pp">switch to no-fill mode:</p>
+<pre>
+in no-fill mode:
+
+back to
+fill mode:
+</pre>
+ENDTEST
--- /dev/null
+++ regress/roff/sp/fill-man.in
@@ -0,0 +1,18 @@
+.\" $OpenBSD: fill-man.in,v 1.1 2019/01/06 04:41:15 schwarze Exp $
+.TH SP-FILL-MAN 1 "January 6, 2019"
+.SH NAME
+sp-fill-man \- interaction of vertical spacing requests with fill modes
+.SH DESCRIPTION
+BEGINTEST
+in fill mode:
+.sp
+switch to no-fill mode:
+.nf
+in no-fill mode:
+.sp
+back to
+fill mode:
+.fi
+ENDTEST
+.br
+end of file
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-01-06  4:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-06  4:55 mandoc: Finally, represent the man(7) .PP and .HP macros by the natural schwarze

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).