source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: docbook2mdoc: rudimentary implementation of <systemitem>
Date: Sat, 13 Apr 2019 10:55:15 -0500 (EST)	[thread overview]
Message-ID: <e3fdc5618f3dcf39@fantadrom.bsd.lv> (raw)

Log Message:
-----------
rudimentary implementation of <systemitem>

Modified Files:
--------------
    docbook2mdoc:
        docbook2mdoc.c
        node.c
        node.h
        statistics.c

Revision Data
-------------
Index: node.h
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/node.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -Lnode.h -Lnode.h -u -p -r1.22 -r1.23
--- node.h
+++ node.h
@@ -137,6 +137,7 @@ enum	nodeid {
 	NODE_SPANSPEC,
 	NODE_SUBTITLE,
 	NODE_SYNOPSIS,
+	NODE_SYSTEMITEM,
 	NODE_TABLE,
 	NODE_TBODY,
 	NODE_TERM,
@@ -191,12 +192,15 @@ enum	attrkey {
  */
 enum	attrval {
 	/* Alpha-order... */
+	ATTRVAL_EVENT,
+	ATTRVAL_IPADDRESS,
 	ATTRVAL_MONOSPACED,
 	ATTRVAL_NOREPEAT,
 	ATTRVAL_OPT,
 	ATTRVAL_PLAIN,
 	ATTRVAL_REPEAT,
 	ATTRVAL_REQ,
+	ATTRVAL_SYSTEMNAME,
 	ATTRVAL__MAX
 };
 
Index: node.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/node.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -Lnode.c -Lnode.c -u -p -r1.12 -r1.13
--- node.c
+++ node.c
@@ -129,6 +129,7 @@ static	const struct nodeprop properties[
 	{ "spanspec",		CLASS_TRANS },
 	{ "subtitle",		CLASS_TRANS },
 	{ "synopsis",		CLASS_BLOCK },
+	{ "systemitem",		CLASS_LINE },
 	{ "table",		CLASS_TRANS },
 	{ "tbody",		CLASS_TRANS },
 	{ "term",		CLASS_LINE },
@@ -169,12 +170,15 @@ static	const char *const attrkeys[ATTRKE
 };
 
 static	const char *const attrvals[ATTRVAL__MAX] = {
+	"event",
+	"ipaddress",
 	"monospaced",
 	"norepeat",
 	"opt",
 	"plain",
 	"repeat",
-	"req"
+	"req",
+	"systemname"
 };
 
 enum attrkey
Index: docbook2mdoc.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/docbook2mdoc.c,v
retrieving revision 1.117
retrieving revision 1.118
diff -Ldocbook2mdoc.c -Ldocbook2mdoc.c -u -p -r1.117 -r1.118
--- docbook2mdoc.c
+++ docbook2mdoc.c
@@ -515,6 +515,22 @@ pnode_printgroup(struct format *f, struc
 }
 
 static void
+pnode_printsystemitem(struct format *f, struct pnode *n)
+{
+	switch (pnode_getattr(n, ATTRKEY_CLASS)) {
+	case ATTRVAL_IPADDRESS:
+		break;
+	case ATTRVAL_SYSTEMNAME:
+		macro_open(f, "Pa");
+		break;
+	case ATTRVAL_EVENT:
+	default:
+		macro_open(f, "Sy");
+		break;
+	}
+}
+
+static void
 pnode_printauthor(struct format *f, struct pnode *n)
 {
 	struct pnode	*nc, *nn;
@@ -1026,6 +1042,9 @@ pnode_print(struct format *f, struct pno
 	case NODE_SCREEN:
 	case NODE_SYNOPSIS:
 		macro_line(f, "Bd -literal");
+		break;
+	case NODE_SYSTEMITEM:
+		pnode_printsystemitem(f, n);
 		break;
 	case NODE_REFENTRYINFO:
 		/* Suppress. */
Index: statistics.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/statistics.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -Lstatistics.c -Lstatistics.c -u -p -r1.21 -r1.22
--- statistics.c
+++ statistics.c
@@ -441,6 +441,7 @@ main(int argc, char *argv[])
 		table_add("structfield", "TEXT");
 		table_add("structname", "TEXT");
 		table_add("symbol", "TEXT");
+		table_add("systemitem", "TEXT");
 		table_add("table", "tgroup");
 		table_add("table", "title");
 		table_add("tbody", "row");
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

                 reply	other threads:[~2019-04-13 15:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=e3fdc5618f3dcf39@fantadrom.bsd.lv \
    --to=schwarze@mandoc.bsd.lv \
    --cc=source@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).