************************************************************************
* Official mandoc TODO.
-* $Id: TODO,v 1.43 2010/09/04 18:52:21 kristaps Exp $
+* $Id: TODO,v 1.44 2010/09/04 19:01:52 kristaps Exp $
************************************************************************
************************************************************************
try e.g. .Bl -column It Ta Ta
reported by millert Fri, 02 Apr 2010 16:13:46 -0400
-- %A doesn't put an "and" before the final author name.
-
************************************************************************
* formatting issues: gratuitious differences
************************************************************************
Opening punctuation should not fall out of .Ns.
see for example OpenBSD csh(1)
-- .%A should append the last author with " and " (if there are two)
- or ", and " (if there are more), not ", "
- see for example OpenBSD csh(1)
-
- In .Bl -bullet, the groff bullet is "+\b+\bo\bo", the mandoc bullet
is just "o\bo".
see for example OpenBSD ksh(1)
-/* $Id: mdoc_html.c,v 1.102 2010/08/20 01:02:07 schwarze Exp $ */
+/* $Id: mdoc_html.c,v 1.103 2010/09/04 19:01:52 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
switch (n->tok) {
case(MDOC__A):
PAIR_CLASS_INIT(&tag[0], "ref-auth");
+ if (n->prev && MDOC__A == n->prev->tok)
+ if (NULL == n->next || MDOC__A != n->next->tok)
+ print_text(h, "and");
break;
case(MDOC__B):
PAIR_CLASS_INIT(&tag[0], "ref-book");
PAIR_HREF_INIT(&tag[1], n->child->string);
print_otag(h, TAG_A, 2, tag);
+
return(1);
}
mdoc__x_post(MDOC_ARGS)
{
+ if (MDOC__A == n->tok && n->next && MDOC__A == n->next->tok)
+ if (NULL == n->next->next || MDOC__A != n->next->next->tok)
+ if (NULL == n->prev || MDOC__A != n->prev->tok)
+ return;
+
/* TODO: %U */
h->flags |= HTML_NOSPACE;
-/* $Id: mdoc_term.c,v 1.183 2010/08/21 14:04:13 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.184 2010/09/04 19:01:52 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
static void termp_sq_post(DECL_ARGS);
static void termp_ss_post(DECL_ARGS);
+static int termp__a_pre(DECL_ARGS);
static int termp_an_pre(DECL_ARGS);
static int termp_ap_pre(DECL_ARGS);
static int termp_aq_pre(DECL_ARGS);
{ termp_under_pre, NULL }, /* Va */
{ termp_vt_pre, NULL }, /* Vt */
{ termp_xr_pre, NULL }, /* Xr */
- { NULL, termp____post }, /* %A */
+ { termp__a_pre, termp____post }, /* %A */
{ termp_under_pre, termp____post }, /* %B */
{ NULL, termp____post }, /* %D */
{ termp_under_pre, termp____post }, /* %I */
}
+/* ARGSUSED */
+static int
+termp__a_pre(DECL_ARGS)
+{
+
+ if (n->prev && MDOC__A == n->prev->tok)
+ if (NULL == n->next || MDOC__A != n->next->tok)
+ term_word(p, "and");
+
+ return(1);
+}
+
+
/* ARGSUSED */
static int
termp_an_pre(DECL_ARGS)
termp____post(DECL_ARGS)
{
+ /*
+ * Handle lists of authors. In general, print each followed by
+ * a comma. Don't print the comma if there are only two
+ * authors.
+ */
+ if (MDOC__A == n->tok && n->next && MDOC__A == n->next->tok)
+ if (NULL == n->next->next || MDOC__A != n->next->next->tok)
+ if (NULL == n->prev || MDOC__A != n->prev->tok)
+ return;
+
/* TODO: %U. */
p->flags |= TERMP_NOSPACE;
--- /dev/null
+.Dd May 1, 2009
+.Dt FOO 1
+.Os
+.Sh NAME
+.Nm foo
+.Nd bar
+.Sh DESCRIPTION
+blah blah
+.Pp
+.Rs
+.%A joe
+.%T title
+.Re
+.Pp
+and so on
--- /dev/null
+.Dd May 1, 2009
+.Dt FOO 1
+.Os
+.Sh NAME
+.Nm foo
+.Nd bar
+.Sh DESCRIPTION
+blah blah
+.Pp
+.Rs
+.%A billy-bob
+.%A joe
+.%A frank
+.%T title
+.Re
+.Pp
+and so on
--- /dev/null
+.Dd May 1, 2009
+.Dt FOO 1
+.Os
+.Sh NAME
+.Nm foo
+.Nd bar
+.Sh DESCRIPTION
+blah blah
+.Pp
+.Rs
+.%A joe
+.%A frank
+.%T title
+.Re
+.Pp
+and so on