source@mandoc.bsd.lv
 help / color / Atom feed
* docbook2mdoc: print commas between Copyright years
@ 2019-05-01 11:34 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2019-05-01 11:34 UTC (permalink / raw)
  To: source

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

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

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-01 11:34 docbook2mdoc: print commas between Copyright years schwarze

source@mandoc.bsd.lv

Archives are clonable: git clone --mirror http://inbox.vuxu.org/mandoc-source

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.mandoc.source


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git