source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: docbook2mdoc: print commas between Copyright years
Date: Wed, 1 May 2019 06:34:50 -0500 (EST)	[thread overview]
Message-ID: <e3fed92ced88dcf7@fantadrom.bsd.lv> (raw)

Log Message:
-----------
print commas between Copyright years

Modified Files:
--------------
    docbook2mdoc:
        docbook2mdoc.c
        node.c
        node.h
        parse.c

Revision Data
-------------
Index: docbook2mdoc.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/docbook2mdoc.c,v
retrieving revision 1.143
retrieving revision 1.144
diff -Ldocbook2mdoc.c -Ldocbook2mdoc.c -u -p -r1.143 -r1.144
--- docbook2mdoc.c
+++ docbook2mdoc.c
@@ -1284,6 +1284,15 @@ pnode_print(struct format *f, struct pno
 	case NODE_SUBTITLE:
 		f->parastate = PARA_WANT;
 		break;
+	case NODE_YEAR:
+		if ((nn = TAILQ_NEXT(n, child)) != NULL &&
+		    nn->node == NODE_YEAR &&
+		    f->linestate == LINE_TEXT) {
+			print_text(f, ",", 0);
+			nn->flags |= NFLAG_SPC;
+			if ((nc = TAILQ_FIRST(&nn->childq)) != NULL)
+				nc->flags |= NFLAG_SPC;
+		}
 	default:
 		break;
 	}
Index: node.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/node.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -Lnode.c -Lnode.c -u -p -r1.26 -r1.27
--- node.c
+++ node.c
@@ -149,6 +149,7 @@ static	const struct nodeprop properties[
 	{ "warning",		CLASS_BLOCK },
 	{ "wordasword",		CLASS_TRANS },
 	{ "xref",		CLASS_LINE },
+	{ "year",		CLASS_TRANS },
 	{ "[UNKNOWN]",		CLASS_VOID },
 	{ "(t)",		CLASS_TEXT },
 	{ "(e)",		CLASS_TEXT }
Index: node.h
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/node.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -Lnode.h -Lnode.h -u -p -r1.35 -r1.36
--- node.h
+++ node.h
@@ -157,6 +157,7 @@ enum	nodeid {
 	NODE_WARNING,
 	NODE_WORDASWORD,
 	NODE_XREF,
+	NODE_YEAR,
 	NODE_UNKNOWN,
 	NODE_TEXT,
 	NODE_ESCAPE,
Index: parse.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/parse.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -Lparse.c -Lparse.c -u -p -r1.55 -r1.56
--- parse.c
+++ parse.c
@@ -130,7 +130,6 @@ static	const struct alias aliases[] = {
 	{ "trademark",		NODE_IGNORE },
 	{ "ulink",		NODE_LINK },
 	{ "userinput",		NODE_LITERAL },
-	{ "year",		NODE_IGNORE },
 	{ NULL,			NODE_IGNORE }
 };
 
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

                 reply	other threads:[~2019-05-01 11:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e3fed92ced88dcf7@fantadrom.bsd.lv \
    --to=schwarze@mandoc.bsd.lv \
    --cc=source@mandoc.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).