tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Stephen Gregoratto <dev@sgregoratto.me>
To: tech@mandoc.bsd.lv
Subject: [PATCH docbook2mdoc] Add void, tag
Date: Sun, 21 Apr 2019 01:48:45 +1000	[thread overview]
Message-ID: <20190420154845.2hm5fx4mqqzq36st@BlackBox> (raw)

This patch adds the <void> and <tag> nodes.

First off, <void>. 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

<sgmltag> morphed into <tag> 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

             reply	other threads:[~2019-04-20 15:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-20 15:48 Stephen Gregoratto [this message]
2019-04-21 14:55 ` Ingo Schwarze

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190420154845.2hm5fx4mqqzq36st@BlackBox \
    --to=dev@sgregoratto.me \
    --cc=tech@mandoc.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).