aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--LICENSE3
-rw-r--r--TODO5
-rw-r--r--man.723
-rw-r--r--man_html.c26
-rw-r--r--man_macro.c7
-rw-r--r--man_term.c62
-rw-r--r--man_validate.c2
-rw-r--r--roff.c5
-rw-r--r--roff.h6
9 files changed, 124 insertions, 15 deletions
diff --git a/LICENSE b/LICENSE
index ec7fc029..cf3d2d4c 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-$Id: LICENSE,v 1.19 2018/07/31 10:18:15 schwarze Exp $
+$Id: LICENSE,v 1.20 2018/08/18 02:08:27 schwarze Exp $
With the exceptions noted below, all code and documentation
contained in the mandoc toolkit is protected by the Copyright
@@ -12,6 +12,7 @@ Copyright (c) 2013 Franco Fichtner <franco@lastsummer.de>
Copyright (c) 2014 Baptiste Daroussin <bapt@freebsd.org>
Copyright (c) 2016 Ed Maste <emaste@freebsd.org>
Copyright (c) 2017 Michael Stapelberg <stapelberg@debian.org>
+Copyright (c) 2017 Anthony Bentley <bentley@openbsd.org>
Copyright (c) 1998, 2004, 2010 Todd C. Miller <Todd.Miller@courtesan.com>
Copyright (c) 2008, 2017 Otto Moerbeek <otto@drijf.net>
Copyright (c) 2004 Ted Unangst <tedu@openbsd.org>
diff --git a/TODO b/TODO
index 50d98a63..121be434 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,6 @@
************************************************************************
* Official mandoc TODO.
-* $Id: TODO,v 1.265 2018/08/16 23:43:37 schwarze Exp $
+* $Id: TODO,v 1.266 2018/08/18 02:08:27 schwarze Exp $
************************************************************************
Many issues are annotated for difficulty as follows:
@@ -162,9 +162,6 @@ are mere guesses, and some may be wrong.
--- missing man features -----------------------------------------------
-- .SY and .YS,
- used by many groff manual pages
-
- groff_www(7) .MTO and .URL
These macros were used by the GNU grep(1) man page.
The groff_www(7) manual page itself uses them, too.
diff --git a/man.7 b/man.7
index 5e302513..d4ef5e48 100644
--- a/man.7
+++ b/man.7
@@ -1,7 +1,8 @@
-.\" $Id: man.7,v 1.138 2018/08/16 23:43:37 schwarze Exp $
+.\" $Id: man.7,v 1.139 2018/08/18 02:08:27 schwarze Exp $
.\"
.\" Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
-.\" Copyright (c) 2011-2015 Ingo Schwarze <schwarze@openbsd.org>
+.\" Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
+.\" Copyright (c) 2017 Anthony Bentley <bentley@openbsd.org>
.\" Copyright (c) 2010 Joerg Sonnenberger <joerg@netbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
@@ -16,7 +17,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: August 16 2018 $
+.Dd $Mdocdate: August 18 2018 $
.Dt MAN 7
.Os
.Sh NAME
@@ -630,6 +631,18 @@ Begin a sub-section.
The scope of a sub-section is closed by a subsequent sub-section,
section, or end of file.
The paragraph left-margin width is reset to the default.
+.Ss \&SY
+Begin a synopsis block with the following syntax:
+.Bd -unfilled -offset indent
+.Pf \. Sx \&SY Ar command
+.Ar arguments
+.Pf \. Sx \&YS
+.Ed
+.Pp
+This is a non-standard GNU extension
+and very rarely used even in GNU manual pages.
+Formatting is similar to
+.Sx \&IP .
.Ss \&TH
Sets the title of the manual page for use in the page header
and footer with the following syntax:
@@ -718,6 +731,10 @@ It has the following syntax:
link description to be shown
.Pf \. Sx UE
.Ed
+.Ss \&YS
+End a synopsis block started by
+.Pf \. Sx SY .
+This is a non-standard GNU extension.
.Ss \&fi
End literal mode begun by
.Sx \&nf .
diff --git a/man_html.c b/man_html.c
index ff816bd2..12cf8ea7 100644
--- a/man_html.c
+++ b/man_html.c
@@ -1,4 +1,4 @@
-/* $Id: man_html.c,v 1.155 2018/08/17 20:33:37 schwarze Exp $ */
+/* $Id: man_html.c,v 1.156 2018/08/18 02:08:27 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013,2014,2015,2017,2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -61,6 +61,7 @@ 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_alt_pre(MAN_ARGS);
static int man_ign_pre(MAN_ARGS);
@@ -101,6 +102,8 @@ static const struct man_html_act man_html_acts[MAN_MAX - MAN_TH] = {
{ man_ign_pre, NULL }, /* PD */
{ man_ign_pre, NULL }, /* AT */
{ man_in_pre, NULL }, /* in */
+ { man_SY_pre, NULL }, /* SY */
+ { NULL, NULL }, /* YS */
{ man_OP_pre, NULL }, /* OP */
{ NULL, NULL }, /* EX */
{ NULL, NULL }, /* EE */
@@ -622,6 +625,27 @@ man_RS_pre(MAN_ARGS)
}
static int
+man_SY_pre(MAN_ARGS)
+{
+ switch (n->type) {
+ case ROFFT_BLOCK:
+ print_otag(h, TAG_TABLE, "c", "Nm");
+ print_otag(h, TAG_TR, "");
+ break;
+ case ROFFT_HEAD:
+ print_otag(h, TAG_TD, "");
+ print_otag(h, TAG_CODE, "cT", "Nm");
+ break;
+ case ROFFT_BODY:
+ print_otag(h, TAG_TD, "");
+ break;
+ default:
+ abort();
+ }
+ return 1;
+}
+
+static int
man_UR_pre(MAN_ARGS)
{
char *cp;
diff --git a/man_macro.c b/man_macro.c
index 2ff58079..cbde3faa 100644
--- a/man_macro.c
+++ b/man_macro.c
@@ -1,4 +1,4 @@
-/* $Id: man_macro.c,v 1.127 2018/08/17 20:33:37 schwarze Exp $ */
+/* $Id: man_macro.c,v 1.128 2018/08/18 02:08:27 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2012-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -71,6 +71,8 @@ static const struct man_macro man_macros[MAN_MAX - MAN_TH] = {
{ in_line_eoln, MAN_NSCOPED }, /* PD */
{ in_line_eoln, 0 }, /* AT */
{ in_line_eoln, MAN_NSCOPED }, /* in */
+ { blk_exp, MAN_BSCOPE }, /* SY */
+ { blk_close, MAN_BSCOPE }, /* YS */
{ in_line_eoln, 0 }, /* OP */
{ in_line_eoln, MAN_BSCOPE }, /* EX */
{ in_line_eoln, MAN_BSCOPE }, /* EE */
@@ -223,6 +225,9 @@ blk_close(MACRO_PROT_ARGS)
return;
}
break;
+ case MAN_YS:
+ ntok = MAN_SY;
+ break;
case MAN_UE:
ntok = MAN_UR;
break;
diff --git a/man_term.c b/man_term.c
index f96e20dd..12314d59 100644
--- a/man_term.c
+++ b/man_term.c
@@ -1,4 +1,4 @@
-/* $Id: man_term.c,v 1.214 2018/08/17 20:33:37 schwarze Exp $ */
+/* $Id: man_term.c,v 1.215 2018/08/18 02:08:27 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -78,6 +78,7 @@ static int pre_PP(DECL_ARGS);
static int pre_RS(DECL_ARGS);
static int pre_SH(DECL_ARGS);
static int pre_SS(DECL_ARGS);
+static int pre_SY(DECL_ARGS);
static int pre_TP(DECL_ARGS);
static int pre_UR(DECL_ARGS);
static int pre_alternate(DECL_ARGS);
@@ -90,6 +91,7 @@ static void post_HP(DECL_ARGS);
static void post_RS(DECL_ARGS);
static void post_SH(DECL_ARGS);
static void post_SS(DECL_ARGS);
+static void post_SY(DECL_ARGS);
static void post_TP(DECL_ARGS);
static void post_UR(DECL_ARGS);
@@ -124,6 +126,8 @@ static const struct man_term_act man_term_acts[MAN_MAX - MAN_TH] = {
{ pre_PD, NULL, MAN_NOTEXT }, /* PD */
{ pre_ign, NULL, 0 }, /* AT */
{ pre_in, NULL, MAN_NOTEXT }, /* in */
+ { pre_SY, post_SY, 0 }, /* SY */
+ { NULL, NULL, 0 }, /* YS */
{ pre_OP, NULL, 0 }, /* OP */
{ pre_literal, NULL, 0 }, /* EX */
{ pre_literal, NULL, 0 }, /* EE */
@@ -849,6 +853,62 @@ post_RS(DECL_ARGS)
}
static int
+pre_SY(DECL_ARGS)
+{
+ const struct roff_node *nn;
+ int len;
+
+ switch (n->type) {
+ case ROFFT_BLOCK:
+ print_bvspace(p, n, mt->pardist);
+ return 1;
+ case ROFFT_HEAD:
+ case ROFFT_BODY:
+ break;
+ default:
+ abort();
+ }
+
+ nn = n->parent->head->child;
+ len = nn == NULL ? 0 : term_strlen(p, nn->string) + 1;
+
+ switch (n->type) {
+ case ROFFT_HEAD:
+ p->tcol->offset = mt->offset;
+ p->tcol->rmargin = mt->offset + len;
+ p->flags |= TERMP_NOBREAK;
+ term_fontrepl(p, TERMFONT_BOLD);
+ break;
+ case ROFFT_BODY:
+ mt->lmargin[mt->lmargincur] = len;
+ p->tcol->offset = mt->offset + len;
+ p->tcol->rmargin = p->maxrmargin;
+ p->flags |= TERMP_NOSPACE;
+ break;
+ default:
+ abort();
+ }
+ return 1;
+}
+
+static void
+post_SY(DECL_ARGS)
+{
+ switch (n->type) {
+ case ROFFT_HEAD:
+ term_flushln(p);
+ p->flags &= ~TERMP_NOBREAK;
+ break;
+ case ROFFT_BODY:
+ term_newln(p);
+ p->tcol->offset = mt->offset;
+ break;
+ default:
+ break;
+ }
+}
+
+static int
pre_UR(DECL_ARGS)
{
diff --git a/man_validate.c b/man_validate.c
index 8a1c33e9..fb859562 100644
--- a/man_validate.c
+++ b/man_validate.c
@@ -85,6 +85,8 @@ static const v_check man_valids[MAN_MAX - MAN_TH] = {
NULL, /* PD */
post_AT, /* AT */
post_in, /* in */
+ NULL, /* SY */
+ NULL, /* YS */
post_OP, /* OP */
NULL, /* EX */
NULL, /* EE */
diff --git a/roff.c b/roff.c
index 766242a1..f5de0f32 100644
--- a/roff.c
+++ b/roff.c
@@ -1,4 +1,4 @@
-/* $Id: roff.c,v 1.332 2018/08/16 23:43:37 schwarze Exp $ */
+/* $Id: roff.c,v 1.333 2018/08/18 02:08:27 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -335,7 +335,8 @@ const char *__roff_name[MAN_MAX + 1] = {
"nf", "fi",
"RE", "RS", "DT", "UC",
"PD", "AT", "in",
- "OP", "EX", "EE", "UR",
+ "SY", "YS", "OP",
+ "EX", "EE", "UR",
"UE", "MT", "ME", NULL
};
const char *const *roff_name = __roff_name;
diff --git a/roff.h b/roff.h
index 161c9a60..68f50acb 100644
--- a/roff.h
+++ b/roff.h
@@ -1,7 +1,7 @@
-/* $Id: roff.h,v 1.60 2018/08/16 23:43:37 schwarze Exp $ */
+/* $Id: roff.h,v 1.61 2018/08/18 02:08:27 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2013,2014,2015,2017,2018 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
@@ -464,6 +464,8 @@ enum roff_tok {
MAN_PD,
MAN_AT,
MAN_in,
+ MAN_SY,
+ MAN_YS,
MAN_OP,
MAN_EX,
MAN_EE,