* docbook2mdoc: Rudimentary implementation of <imagedata> by printing the
@ 2019-04-14 22:38 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2019-04-14 22:38 UTC (permalink / raw)
To: source
Log Message:
-----------
Rudimentary implementation of <imagedata> by printing the filename.
Ignore the wrappers <caption>, <figure>, <imageobject>, <mediaobject>.
Modified Files:
--------------
docbook2mdoc:
docbook2mdoc.c
node.c
node.h
parse.c
statistics.c
Revision Data
-------------
Index: node.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/node.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -Lnode.c -Lnode.c -u -p -r1.17 -r1.18
--- node.c
+++ node.c
@@ -66,6 +66,7 @@ static const struct nodeprop properties[
{ "function", CLASS_LINE },
{ "glossterm", CLASS_LINE },
{ "group", CLASS_ENCL },
+ { "imagedata", CLASS_TEXT },
{ "xi:include", CLASS_VOID },
{ "index", CLASS_TRANS },
{ "info", CLASS_TRANS },
@@ -154,6 +155,8 @@ static const char *const attrkeys[ATTRKE
"cols",
"DEFINITION",
"endterm",
+ "entityref",
+ "fileref",
"href",
"id",
"linkend",
Index: node.h
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/node.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -Lnode.h -Lnode.h -u -p -r1.26 -r1.27
--- node.h
+++ node.h
@@ -74,6 +74,7 @@ enum nodeid {
NODE_FUNCTION,
NODE_GLOSSTERM,
NODE_GROUP,
+ NODE_IMAGEDATA,
NODE_INCLUDE,
NODE_INDEX,
NODE_INFO,
@@ -170,6 +171,8 @@ enum attrkey {
ATTRKEY_COLS,
ATTRKEY_DEFINITION,
ATTRKEY_ENDTERM,
+ ATTRKEY_ENTITYREF,
+ ATTRKEY_FILEREF,
ATTRKEY_HREF,
ATTRKEY_ID,
ATTRKEY_LINKEND,
Index: docbook2mdoc.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/docbook2mdoc.c,v
retrieving revision 1.125
retrieving revision 1.126
diff -Ldocbook2mdoc.c -Ldocbook2mdoc.c -u -p -r1.125 -r1.126
--- docbook2mdoc.c
+++ docbook2mdoc.c
@@ -126,6 +126,21 @@ pnode_printtext(struct format *f, struct
}
static void
+pnode_printimagedata(struct format *f, struct pnode *n)
+{
+ const char *cp;
+
+ if ((cp = pnode_getattr_raw(n, ATTRKEY_FILEREF, NULL)) == NULL)
+ cp = pnode_getattr_raw(n, ATTRKEY_ENTITYREF, NULL);
+ if (cp != NULL) {
+ print_text(f, "[image:", ARG_SPACE);
+ print_text(f, cp, ARG_SPACE);
+ print_text(f, "]", 0);
+ } else
+ print_text(f, "[image]", ARG_SPACE);
+}
+
+static void
pnode_printpara(struct format *f, struct pnode *n)
{
struct pnode *np;
@@ -1108,6 +1123,9 @@ pnode_print(struct format *f, struct pno
break;
case NODE_FUNCSYNOPSISINFO:
macro_open(f, "Fd");
+ break;
+ case NODE_IMAGEDATA:
+ pnode_printimagedata(f, n);
break;
case NODE_INFORMALEQUATION:
macro_line(f, "Bd -ragged -offset indent");
Index: statistics.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/statistics.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -Lstatistics.c -Lstatistics.c -u -p -r1.31 -r1.32
--- statistics.c
+++ statistics.c
@@ -399,6 +399,7 @@ main(int argc, char *argv[])
table_add("bookinfo", "releaseinfo");
table_add("bookinfo", "subtitle");
table_add("bookinfo", "title");
+ table_add("caption", "TEXT");
table_add("chapter", NULL);
table_add("citerefentry", "manvolnum");
table_add("citerefentry", "refentrytitle");
@@ -423,6 +424,7 @@ main(int argc, char *argv[])
table_add("emphasis", "TEXT");
table_add("entry", NULL);
table_add("errorname", "TEXT");
+ table_add("figure", "mediaobject");
table_add("filename", "TEXT");
table_add("firstname", "TEXT");
table_add("firstterm", "TEXT");
@@ -447,6 +449,7 @@ main(int argc, char *argv[])
table_add("glossterm", "TEXT");
table_add("group", "arg");
table_add("holder", "TEXT");
+ table_add("imageobject", "imagedata");
table_add("indexterm", "primary");
table_add("indexterm", "secondary");
table_add("informaltable", "tgroup");
@@ -461,6 +464,8 @@ main(int argc, char *argv[])
table_add("literallayout", NULL);
table_add("manvolnum", "TEXT");
table_add("markup", "TEXT");
+ table_add("mediaobject", "caption");
+ table_add("mediaobject", "imageobject");
table_add("member", "constant");
table_add("member", "emphasis");
table_add("member", "function");
Index: parse.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/parse.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -Lparse.c -Lparse.c -u -p -r1.43 -r1.44
--- parse.c
+++ parse.c
@@ -77,9 +77,11 @@ static const struct alias aliases[] = {
{ "articleinfo", NODE_BOOKINFO },
{ "book", NODE_SECTION },
{ "chapter", NODE_SECTION },
+ { "caption", NODE_IGNORE },
{ "code", NODE_LITERAL },
{ "computeroutput", NODE_LITERAL },
{ "!doctype", NODE_DOCTYPE },
+ { "figure", NODE_IGNORE },
{ "firstname", NODE_PERSONNAME },
{ "glossary", NODE_VARIABLELIST },
{ "glossdef", NODE_IGNORE },
@@ -87,10 +89,12 @@ static const struct alias aliases[] = {
{ "glossentry", NODE_VARLISTENTRY },
{ "glosslist", NODE_VARIABLELIST },
{ "holder", NODE_IGNORE },
+ { "imageobject", NODE_IGNORE },
{ "indexterm", NODE_DELETE },
{ "informaltable", NODE_TABLE },
{ "keycap", NODE_KEYSYM },
{ "keycode", NODE_IGNORE },
+ { "mediaobject", NODE_BLOCKQUOTE },
{ "orgname", NODE_IGNORE },
{ "othercredit", NODE_AUTHOR },
{ "othername", NODE_PERSONNAME },
--
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 22:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-14 22:38 docbook2mdoc: Rudimentary implementation of <imagedata> by printing the 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).