source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: docbook2mdoc: render <superscript> and <subscript> with \(ha and _
Date: Sun, 14 Apr 2019 15:13:56 -0500 (EST)	[thread overview]
Message-ID: <e3fdd4d13bf5a523@fantadrom.bsd.lv> (raw)

Log Message:
-----------
render <superscript> and <subscript> with \(ha and _

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

Revision Data
-------------
Index: node.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/node.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -Lnode.c -Lnode.c -u -p -r1.15 -r1.16
--- node.c
+++ node.c
@@ -123,7 +123,9 @@ static	const struct nodeprop properties[
 	{ "simplelist",		CLASS_TRANS },
 	{ "simplesect",		CLASS_BLOCK },
 	{ "spanspec",		CLASS_TRANS },
+	{ "subscript",		CLASS_TEXT },
 	{ "subtitle",		CLASS_BLOCK },
+	{ "superscript",	CLASS_TEXT },
 	{ "synopsis",		CLASS_BLOCK },
 	{ "systemitem",		CLASS_LINE },
 	{ "table",		CLASS_TRANS },
Index: docbook2mdoc.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/docbook2mdoc.c,v
retrieving revision 1.123
retrieving revision 1.124
diff -Ldocbook2mdoc.c -Ldocbook2mdoc.c -u -p -r1.123 -r1.124
--- docbook2mdoc.c
+++ docbook2mdoc.c
@@ -1224,6 +1224,19 @@ pnode_print(struct format *f, struct pno
 	case NODE_SBR:
 		macro_line(f, "br");
 		break;
+	case NODE_SUBSCRIPT:
+		if (f->linestate == LINE_MACRO)
+			macro_addarg(f, "_", 0);
+		else
+			print_text(f, "_", 0);
+		if ((nc = TAILQ_FIRST(&n->childq)) != NULL)
+			nc->spc = 0;
+		break;
+	case NODE_SUPERSCRIPT:
+		fputs("\\(ha", stdout);
+		if ((nc = TAILQ_FIRST(&n->childq)) != NULL)
+			nc->spc = 0;
+		break;
 	case NODE_TEXT:
 	case NODE_ESCAPE:
 		pnode_printtext(f, n);
Index: node.h
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/node.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -Lnode.h -Lnode.h -u -p -r1.25 -r1.26
--- node.h
+++ node.h
@@ -131,7 +131,9 @@ enum	nodeid {
 	NODE_SIMPLELIST,
 	NODE_SIMPLESECT,
 	NODE_SPANSPEC,
+	NODE_SUBSCRIPT,
 	NODE_SUBTITLE,
+	NODE_SUPERSCRIPT,
 	NODE_SYNOPSIS,
 	NODE_SYSTEMITEM,
 	NODE_TABLE,
Index: statistics.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/statistics.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -Lstatistics.c -Lstatistics.c -u -p -r1.29 -r1.30
--- statistics.c
+++ statistics.c
@@ -460,6 +460,11 @@ main(int argc, char *argv[])
 		table_add("literallayout", NULL);
 		table_add("manvolnum", "TEXT");
 		table_add("markup", "TEXT");
+		table_add("member", "constant");
+		table_add("member", "emphasis");
+		table_add("member", "function");
+		table_add("member", "property");
+		table_add("member", "symbol");
 		table_add("member", "TEXT");
 		table_add("note", NULL);
 		table_add("option", "parameter");
@@ -529,7 +534,10 @@ main(int argc, char *argv[])
 		table_add("simplesect", NULL);
 		table_add("structfield", "TEXT");
 		table_add("structname", "TEXT");
+		table_add("subscript", "TEXT");
 		table_add("subtitle", "TEXT");
+		table_add("superscript", "emphasis");
+		table_add("superscript", "TEXT");
 		table_add("surname", "TEXT");
 		table_add("symbol", "TEXT");
 		table_add("synopsis", "TEXT");
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

                 reply	other threads:[~2019-04-14 20:13 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=e3fdd4d13bf5a523@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).