From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from scc-mailout-kit-02.scc.kit.edu (scc-mailout-kit-02.scc.kit.edu [129.13.231.82]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id 56b13fcf for ; Fri, 12 Apr 2019 02:14:27 -0500 (EST) Received: from asta-nat.asta.uni-karlsruhe.de ([172.22.63.82] helo=hekate.usta.de) by scc-mailout-kit-02.scc.kit.edu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (envelope-from ) id 1hEqOG-0000M4-UY; Fri, 12 Apr 2019 09:14:26 +0200 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.77) (envelope-from ) id 1hEqOF-0000ax-Qs; Fri, 12 Apr 2019 09:14:23 +0200 Received: from athene.usta.de ([172.24.96.10]) by donnerwolke.usta.de with esmtp (Exim 4.84_2) (envelope-from ) id 1hEqOF-0003v2-ND; Fri, 12 Apr 2019 09:14:23 +0200 Received: from localhost (athene.usta.de [local]) by athene.usta.de (OpenSMTPD) with ESMTPA id 2fc9678c; Fri, 12 Apr 2019 09:14:23 +0200 (CEST) Date: Fri, 12 Apr 2019 09:14:23 +0200 From: Ingo Schwarze To: Stephen Gregoratto Cc: tech@mandoc.bsd.lv Subject: Re: [PATCH docbook2mdoc] Add markup, computeroutput (WIP) Message-ID: <20190412071423.GA89835@athene.usta.de> References: <20190412055748.umynmdcylrtp5pbs@BlackBox> X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190412055748.umynmdcylrtp5pbs@BlackBox> User-Agent: Mutt/1.8.0 (2017-02-23) Hi Stephen, Stephen Gregoratto wrote on Fri, Apr 12, 2019 at 03:57:48PM +1000: > Both of these are frequently used in the doclifter manpage. Thanks for pointing out where they are used. > 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. Your argument makes sense to me. I committed your patch unchanged. > 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). I think you habe a point here, text escaping is not consistent. I should fix that, but that's independent of your patch. > 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 Sure, makes sense, too. There is a slight problem with NODE_LITERAL formatting: It is translated to .Ql, but sometimes, authors manually put quotes around it. The formatter should probably delete those additional quotes. But again, that's independent of your patch. Thanks, Ingo > 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 }, -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv