From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 36eb0855 for ; Mon, 15 Apr 2019 14:15:49 -0500 (EST) Date: Mon, 15 Apr 2019 14:15:49 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: docbook2mdoc: Minimal translation of to .Sx. X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: Log Message: ----------- Minimal translation of to .Sx. This might need refinement in the future, but that won't be easy because the element is horribly underspecified and the usage is practice is very inconsistent. Modified Files: -------------- docbook2mdoc: docbook2mdoc.c node.c node.h Revision Data ------------- Index: docbook2mdoc.c =================================================================== RCS file: /home/cvs/mdocml/docbook2mdoc/docbook2mdoc.c,v retrieving revision 1.128 retrieving revision 1.129 diff -Ldocbook2mdoc.c -Ldocbook2mdoc.c -u -p -r1.128 -r1.129 --- docbook2mdoc.c +++ docbook2mdoc.c @@ -625,6 +625,18 @@ pnode_printauthor(struct format *f, stru } static void +pnode_printxref(struct format *f, struct pnode *n) +{ + const char *linkend; + + linkend = pnode_getattr_raw(n, ATTRKEY_LINKEND, NULL); + if (linkend != NULL) { + macro_open(f, "Sx"); + macro_addarg(f, linkend, ARG_SPACE); + } +} + +static void pnode_printlink(struct format *f, struct pnode *n) { struct pnode *nc; @@ -1320,6 +1332,9 @@ pnode_print(struct format *f, struct pno break; case NODE_VARNAME: macro_open(f, "Va"); + break; + case NODE_XREF: + pnode_printxref(f, n); break; default: break; Index: node.c =================================================================== RCS file: /home/cvs/mdocml/docbook2mdoc/node.c,v retrieving revision 1.19 retrieving revision 1.20 diff -Lnode.c -Lnode.c -u -p -r1.19 -r1.20 --- node.c +++ node.c @@ -144,6 +144,7 @@ static const struct nodeprop properties[ { "varname", CLASS_LINE }, { "warning", CLASS_BLOCK }, { "wordasword", CLASS_TRANS }, + { "xref", CLASS_LINE }, { "[UNKNOWN]", CLASS_VOID }, { "(t)", CLASS_TEXT }, { "(e)", CLASS_TEXT } Index: node.h =================================================================== RCS file: /home/cvs/mdocml/docbook2mdoc/node.h,v retrieving revision 1.28 retrieving revision 1.29 diff -Lnode.h -Lnode.h -u -p -r1.28 -r1.29 --- node.h +++ node.h @@ -152,6 +152,7 @@ enum nodeid { NODE_VARNAME, NODE_WARNING, NODE_WORDASWORD, + NODE_XREF, NODE_UNKNOWN, NODE_TEXT, NODE_ESCAPE, -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv