source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* docbook2mdoc: Add trademark, format constant.
@ 2014-04-30  9:26 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2014-04-30  9:26 UTC (permalink / raw)
  To: source

Log Message:
-----------
Add trademark, format constant.

Modified Files:
--------------
    docbook2mdoc:
        docbook2mdoc.c
        extern.h
        rules.c

Revision Data
-------------
Index: extern.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/docbook2mdoc/extern.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -Lextern.h -Lextern.h -u -p -r1.18 -r1.19
--- extern.h
+++ extern.h
@@ -76,6 +76,7 @@ enum	nodeid {
 	NODE_THEAD,
 	NODE_TIP,
 	NODE_TITLE,
+	NODE_TRADEMARK,
 	NODE_ULINK,
 	NODE_USERINPUT,
 	NODE_VARIABLELIST,
Index: docbook2mdoc.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/docbook2mdoc/docbook2mdoc.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -Ldocbook2mdoc.c -Ldocbook2mdoc.c -u -p -r1.32 -r1.33
--- docbook2mdoc.c
+++ docbook2mdoc.c
@@ -156,6 +156,7 @@ static	const struct node nodes[NODE__MAX
 	{ "thead", NODE_IGNTEXT }, 
 	{ "tip", NODE_IGNTEXT }, 
 	{ "title", 0 }, 
+	{ "trademark", 0 }, 
 	{ "ulink", 0 }, 
 	{ "userinput", 0 }, 
 	{ "variablelist", NODE_IGNTEXT }, 
@@ -944,6 +945,7 @@ pnode_printvarlistentry(struct parse *p,
 	assert(p->newln);
 	TAILQ_FOREACH(pp, &pn->childq, child)
 		if (NODE_TERM == pp->node) {
+			assert(p->newln);
 			fputs(".It", stdout);
 			p->newln = 0;
 			pnode_print(p, pp);
@@ -1097,6 +1099,10 @@ pnode_print(struct parse *p, struct pnod
 		pnode_printmopen(p);
 		fputs("Nm", stdout);
 		break;
+	case (NODE_CONSTANT):
+		pnode_printmopen(p);
+		fputs("Dv", stdout);
+		break;
 	case (NODE_EMPHASIS):
 		pnode_printmopen(p);
 		fputs("Em", stdout);
@@ -1305,6 +1311,7 @@ pnode_print(struct parse *p, struct pnod
 	case (NODE_ARG):
 	case (NODE_CODE):
 	case (NODE_COMMAND):
+	case (NODE_CONSTANT):
 	case (NODE_EMPHASIS):
 	case (NODE_ENVAR):
 	case (NODE_FILENAME):
Index: rules.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/docbook2mdoc/rules.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -Lrules.c -Lrules.c -u -p -r1.18 -r1.19
--- rules.c
+++ rules.c
@@ -524,6 +524,7 @@ isparent(enum nodeid node, enum nodeid p
 		case (NODE_SCREEN):
 		case (NODE_SYNOPSIS):
 		case (NODE_TERM):
+		case (NODE_TRADEMARK):
 		case (NODE_ULINK):
 		case (NODE_USERINPUT):
 		case (NODE_VARNAME):
@@ -853,6 +854,7 @@ isparent(enum nodeid node, enum nodeid p
 		case (NODE_SYNOPSIS):
 		case (NODE_TERM):
 		case (NODE_TITLE):
+		case (NODE_TRADEMARK):
 		case (NODE_ULINK):
 		case (NODE_USERINPUT):
 		case (NODE_VARNAME):
@@ -1045,6 +1047,30 @@ isparent(enum nodeid node, enum nodeid p
 		case (NODE_TIP):
 		case (NODE_VARIABLELIST):
 		case (NODE_WARNING):
+			return(1);
+		default:
+			break;
+		}
+		return(0);
+	case (NODE_TRADEMARK):
+		switch (parent) {
+		case (NODE_ACRONYM):
+		case (NODE_EMPHASIS):
+		case (NODE_ENTRY):
+		case (NODE_FUNCSYNOPSISINFO):
+		case (NODE_LINK):
+		case (NODE_ULINK):
+		case (NODE_PARA):
+		case (NODE_PROGRAMLISTING):
+		case (NODE_QUOTE):
+		case (NODE_REFDESCRIPTOR):
+		case (NODE_REFENTRYTITLE):
+		case (NODE_REFNAME):
+		case (NODE_REFPURPOSE):
+		case (NODE_SCREEN):
+		case (NODE_SYNOPSIS):
+		case (NODE_TERM):
+		case (NODE_TITLE):
 			return(1);
 		default:
 			break;
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

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

only message in thread, other threads:[~2014-04-30  9:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-30  9:26 docbook2mdoc: Add trademark, format constant kristaps

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