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 d5b66c04 for ; Fri, 12 Apr 2019 00:57:53 -0500 (EST) Received: from mail.sgregoratto.me (localhost [127.0.0.1]) by mail.sgregoratto.me (Postfix) with ESMTP id 047033E941 for ; Fri, 12 Apr 2019 15:57:50 +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=1555048669; x=1557640670; bh=Q5DAsdoigOBcgEy2Yk2ju8RZ pv8B6TwwTNLRcHYq/g4=; b=NiYgi0ldgESqiGq5Y/pvqgAmF5NMsWBMMRt0G7Xu NJi8p4M2R7dfJ86nuwSzupKe+EHbkzhaRsQ1F6uhhNEg2Zfr7+dXKTd6iZ2YUVzZ Gf40lIqN3TCDeULH0Eylh/9jBcfC5DWfymZAX9Y89Qi2akPrt2oSuJvQ+i2c6QIK QgQ= 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 UFPgKtaDWAwi for ; Fri, 12 Apr 2019 15:57:49 +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 E65883E82E for ; Fri, 12 Apr 2019 15:57:48 +1000 (AEST) Date: Fri, 12 Apr 2019 15:57:48 +1000 From: Stephen Gregoratto To: tech@mandoc.bsd.lv Subject: [PATCH docbook2mdoc] Add markup, computeroutput (WIP) Message-ID: <20190412055748.umynmdcylrtp5pbs@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 Both of these are frequently used in the doclifter manpage. First up, . The docs say: > A markup element contains a string of formatting markup that is to be > represented literally in the text. The utility of this element is > almost wholly constrained to books about document formatting tools. doclifter uses it to designate troff macros, e.g .Pp. Since this is similar to , I decided to set NODE_SGMLTAG to the new NODE_MARKUP. The only problem is that using macro_open(f, "Ic") doesn't escape the markup like pnode_printtext does (worst case would format as: .Ic Pp). Secondly, . The docs say: > A computeroutput identifies lines of text generated by a computer > program (messages, results, or other output). Setting this to NODE_LITERAL Index: docbook2mdoc.c =================================================================== RCS file: /cvs/docbook2mdoc/docbook2mdoc.c,v retrieving revision 1.105 diff -u -p -r1.105 docbook2mdoc.c --- docbook2mdoc.c 12 Apr 2019 04:17:11 -0000 1.105 +++ docbook2mdoc.c 12 Apr 2019 05:53:31 -0000 @@ -914,6 +914,9 @@ pnode_print(struct format *f, struct pno macro_argline(f, "Bd", pnode_getattr(n, ATTRKEY_CLASS) == ATTRVAL_MONOSPACED ? "-literal" : "-unfilled"); break; + case NODE_MARKUP: + macro_open(f, "Ic"); + break; case NODE_MML_MFENCED: pnode_printmathfenced(f, n); break; @@ -988,9 +991,6 @@ pnode_print(struct format *f, struct pno break; case NODE_SBR: macro_line(f, "br"); - break; - case NODE_SGMLTAG: - macro_open(f, "Ic"); break; case NODE_TEXT: case NODE_ESCAPE: Index: node.h =================================================================== RCS file: /cvs/docbook2mdoc/node.h,v retrieving revision 1.17 diff -u -p -r1.17 node.h --- node.h 12 Apr 2019 04:39:24 -0000 1.17 +++ node.h 12 Apr 2019 05:53:31 -0000 @@ -82,6 +82,7 @@ enum nodeid { NODE_LITERAL, NODE_LITERALLAYOUT, NODE_MANVOLNUM, + NODE_MARKUP, NODE_MEMBER, NODE_MML_MATH, NODE_MML_MFENCED, @@ -123,7 +124,6 @@ enum nodeid { NODE_SBR, NODE_SCREEN, NODE_SECTION, - NODE_SGMLTAG, NODE_SIMPLELIST, NODE_SPANSPEC, NODE_SUBTITLE, Index: parse.c =================================================================== RCS file: /cvs/docbook2mdoc/parse.c,v retrieving revision 1.34 diff -u -p -r1.34 parse.c --- parse.c 12 Apr 2019 04:39:24 -0000 1.34 +++ parse.c 12 Apr 2019 05:53:31 -0000 @@ -89,6 +89,7 @@ static const struct element elements[] = { "code", NODE_LITERAL }, { "colspec", NODE_COLSPEC }, { "command", NODE_COMMAND }, + { "computeroutput", NODE_LITERAL }, { "constant", NODE_CONSTANT }, { "contrib", NODE_CONTRIB }, { "copyright", NODE_COPYRIGHT }, @@ -134,6 +135,7 @@ static const struct element elements[] = { "literal", NODE_LITERAL }, { "literallayout", NODE_LITERALLAYOUT }, { "manvolnum", NODE_MANVOLNUM }, + { "markup", NODE_MARKUP }, { "member", NODE_MEMBER }, { "mml:math", NODE_MML_MATH }, { "mml:mfenced", NODE_MML_MFENCED }, @@ -186,7 +188,7 @@ static const struct element elements[] = { "sect1", NODE_SECTION }, { "sect2", NODE_SECTION }, { "section", NODE_SECTION }, - { "sgmltag", NODE_SGMLTAG }, + { "sgmltag", NODE_MARKUP }, { "simpara", NODE_PARA }, { "simplelist", NODE_SIMPLELIST }, { "spanspec", NODE_SPANSPEC }, -- Stephen Gregoratto PGP: 3FC6 3D0E 2801 C348 1C44 2D34 A80C 0F8E 8BAB EC8:q -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv