source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: docbook2mdoc: translate NODE_LINK to .Sx
Date: Fri, 22 Mar 2019 11:51:25 -0500 (EST)	[thread overview]
Message-ID: <e3fc91e3daee8a17@fantadrom.bsd.lv> (raw)

Log Message:
-----------
translate NODE_LINK to .Sx

Modified Files:
--------------
    docbook2mdoc:
        docbook2mdoc.c
        extern.h

Revision Data
-------------
Index: docbook2mdoc.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/docbook2mdoc.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -Ldocbook2mdoc.c -Ldocbook2mdoc.c -u -p -r1.57 -r1.58
--- docbook2mdoc.c
+++ docbook2mdoc.c
@@ -79,6 +79,7 @@ static	const char *attrkeys[ATTRKEY__MAX
 	"choice",
 	"close",
 	"id",
+	"linkend",
 	"open",
 	"rep"
 };
@@ -1254,6 +1255,7 @@ static void
 pnode_print(struct parse *p, struct pnode *pn)
 {
 	struct pnode	*pp;
+	struct pattr	*ap;
 	char		*cp;
 	int		 last, sv;
 
@@ -1361,6 +1363,16 @@ pnode_print(struct parse *p, struct pnod
 		assert(p->newln);
 		puts(".Sh LEGAL NOTICE");
 		break;
+	case (NODE_LINK):
+		TAILQ_FOREACH(ap, &pn->attrq, child)
+			if (ATTRKEY_LINKEND == ap->key)
+				break;
+		if (ap == NULL)
+			break;
+		pnode_printmopen(p);
+		printf("Sx %s\n", ap->rawval);
+		p->newln = 1;
+		return;
 	case (NODE_LITERAL):
 		pnode_printmopen(p);
 		fputs("Li", stdout);
Index: extern.h
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/extern.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -Lextern.h -Lextern.h -u -p -r1.29 -r1.30
--- extern.h
+++ extern.h
@@ -154,6 +154,7 @@ enum	attrkey {
 	ATTRKEY_CHOICE = 0,
 	ATTRKEY_CLOSE,
 	ATTRKEY_ID,
+	ATTRKEY_LINKEND,
 	ATTRKEY_OPEN,
 	ATTRKEY_REP,
 	ATTRKEY__MAX
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

                 reply	other threads:[~2019-03-22 16:51 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=e3fc91e3daee8a17@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).