From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.sgregoratto.me (mail.sgregoratto.me [149.28.166.45]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id 9be2b4e6 for ; Sat, 20 Apr 2019 10:48:49 -0500 (EST) Received: from mail.sgregoratto.me (localhost [127.0.0.1]) by mail.sgregoratto.me (Postfix) with ESMTP id 68D283E8BB for ; Sun, 21 Apr 2019 01:48:46 +1000 (AEST) Authentication-Results: mail.sgregoratto.me (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=sgregoratto.me DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sgregoratto.me; h=user-agent:content-disposition:content-type:content-type :mime-version:message-id:subject:subject:to:from:from:date:date; s=dkim; t=1555775325; x=1558367326; bh=Q2DANvTkly8JpLvgRsx2zuY6 GFaIF4vLitpBpMMZXdY=; b=VvMlLx5rUhz8h7ATgApGmN0cYoMPoqlGHtI/Y7zU oNq7EtceJZSALNoE8YMG0xLxd9PeA1BoBRQjOowwMZ5b8WKfHiC5cQY3xna1bw6A xOonE1UM1B9IARW2gScynnDSlHglNCia1mbwyc8TwsBcaxqGSPHMTno3RJwdjoH3 2T8= X-Virus-Scanned: Debian amavisd-new at mail.sgregoratto.me Received: from mail.sgregoratto.me ([127.0.0.1]) by mail.sgregoratto.me (mail.sgregoratto.me [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id eDY068pVF4Yj for ; Sun, 21 Apr 2019 01:48:45 +1000 (AEST) Received: from localhost (172.44.179.58.sta.dodo.net.au [58.179.44.172]) by mail.sgregoratto.me (Postfix) with ESMTPSA id BF76C3E8B3 for ; Sun, 21 Apr 2019 01:48:45 +1000 (AEST) Date: Sun, 21 Apr 2019 01:48:45 +1000 From: Stephen Gregoratto To: tech@mandoc.bsd.lv Subject: [PATCH docbook2mdoc] Add void, tag Message-ID: <20190420154845.2hm5fx4mqqzq36st@BlackBox> Mail-Followup-To: tech@mandoc.bsd.lv X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: NeoMutt/20180716 This patch adds the and nodes. First off, . From the docs: > The void element produces generated text that indicates the function > has no arguments (or returns nothing). The exact generated text may > vary. One common result is void. Found this in the xenocara tree. Output as .Ft void in an .Fo block morphed into in DocBook 5.*, and so it should be formatted the same. Found this when using the official db4-upgrade stylesheet on some files. Index: docbook2mdoc.c =================================================================== RCS file: /cvs/docbook2mdoc/docbook2mdoc.c,v retrieving revision 1.131 diff -u -p -r1.131 docbook2mdoc.c --- docbook2mdoc.c 16 Apr 2019 21:21:27 -0000 1.131 +++ docbook2mdoc.c 20 Apr 2019 15:40:43 -0000 @@ -321,8 +321,11 @@ pnode_printfuncdef(struct format *f, str struct pnode *nc; nc = TAILQ_FIRST(&n->childq); - if (nc != NULL && nc->node == NODE_TEXT) { - macro_argline(f, "Ft", nc->b); + if (nc != NULL) { + if (nc->node == NODE_VOID) + macro_argline(f, "Ft", "void"); + else if (nc->node == NODE_TEXT) + macro_argline(f, "Ft", nc->b); pnode_unlink(nc); } macro_nodeline(f, "Fo", n, ARG_SINGLE); Index: node.c =================================================================== RCS file: /cvs/docbook2mdoc/node.c,v retrieving revision 1.22 diff -u -p -r1.22 node.c --- node.c 16 Apr 2019 21:21:27 -0000 1.22 +++ node.c 20 Apr 2019 15:40:43 -0000 @@ -143,6 +143,7 @@ static const struct nodeprop properties[ { "variablelist", CLASS_BLOCK }, { "varlistentry", CLASS_BLOCK }, { "varname", CLASS_LINE }, + { "void", CLASS_LINE }, { "warning", CLASS_BLOCK }, { "wordasword", CLASS_TRANS }, { "xref", CLASS_LINE }, Index: node.h =================================================================== RCS file: /cvs/docbook2mdoc/node.h,v retrieving revision 1.31 diff -u -p -r1.31 node.h --- node.h 16 Apr 2019 21:21:27 -0000 1.31 +++ node.h 20 Apr 2019 15:40:43 -0000 @@ -152,6 +152,7 @@ enum nodeid { NODE_VARIABLELIST, NODE_VARLISTENTRY, NODE_VARNAME, + NODE_VOID, NODE_WARNING, NODE_WORDASWORD, NODE_XREF, Index: parse.c =================================================================== RCS file: /cvs/docbook2mdoc/parse.c,v retrieving revision 1.47 diff -u -p -r1.47 parse.c --- parse.c 20 Apr 2019 04:15:06 -0000 1.47 +++ parse.c 20 Apr 2019 15:40:43 -0000 @@ -120,6 +121,7 @@ static const struct alias aliases[] = { { "structname", NODE_TYPE }, { "surname", NODE_PERSONNAME }, { "symbol", NODE_CONSTANT }, + { "tag", NODE_MARKUP }, { "trademark", NODE_IGNORE }, { "ulink", NODE_LINK }, { "userinput", NODE_LITERAL }, -- Stephen Gregoratto PGP: 3FC6 3D0E 2801 C348 1C44 2D34 A80C 0F8E 8BAB EC8B -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv