* docbook2mdoc: render <superscript> and <subscript> with \(ha and _
@ 2019-04-14 20:13 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2019-04-14 20:13 UTC (permalink / raw)
To: source
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-04-14 20:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-14 20:13 docbook2mdoc: render <superscript> and <subscript> with \(ha and _ schwarze
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).