From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (kristaps@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id s32CR5Sh005896 for ; Wed, 2 Apr 2014 08:27:05 -0400 (EDT) Received: (from kristaps@localhost) by krisdoz.my.domain (8.14.5/8.14.3/Submit) id s32CR5Fo025991; Wed, 2 Apr 2014 08:27:05 -0400 (EDT) Date: Wed, 2 Apr 2014 08:27:05 -0400 (EDT) Message-Id: <201404021227.s32CR5Fo025991@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: kristaps@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: docbook2mdoc: Improve (and fix) manpage and index page. X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Improve (and fix) manpage and index page. Remove now-trivial examples. Modified Files: -------------- docbook2mdoc: Makefile docbook2mdoc.1 docbook2mdoc.c index.xml Removed Files: ------------- docbook2mdoc: as.xml iovec.xml ls.xml printf.xml Revision Data ------------- --- ls.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - ls - 1 - - - - ls - list contents of a directory - - - - - /usr/bin/ls - - - - file - - - - Description - - For each file that is a directory, ls lists the contents of - the directory; for each file that is an ordinary file, ls - repeats its name and any other information requested. - - ... - - --- iovec.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - iovec - 9S - - - - iovec - data storage structure for I/O using uio - - - - - #include <sys/uio.h> - - - - Interface Level - - Architecture independent level 1 (DDI/DKI). - - - - Description - - - An iovec structure describes a data - storage area for transfer in a - uio - 9S - - structure. Conceptually, - it may be thought of as a base address and length specification. - - - - Structure Members - - - caddr_t iov_base; /* base address of the data storage area */ - /* represented by the iovec structure */ - int iov_len; /* size of the data storage area in bytes */ - - - ... - - Index: docbook2mdoc.1 =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/docbook2mdoc/docbook2mdoc.1,v retrieving revision 1.1 retrieving revision 1.2 diff -Ldocbook2mdoc.1 -Ldocbook2mdoc.1 -u -p -r1.1 -r1.2 --- docbook2mdoc.1 +++ docbook2mdoc.1 @@ -21,7 +21,7 @@ .Nm docbook2mdoc .Nd Convert DocBook refentry to mdoc .Sh SYNOPSIS -.Nm docbook2man +.Nm docbook2mdoc .Op Ar file .Sh DESCRIPTION The @@ -33,12 +33,18 @@ generates .Xr mdoc 7 from the .Aq refentry -section of DocBook source. +section of DocBook source, ignoring other sections. If unspecified or .Ar \&- , .Ar file is taken to be standard input. It accepts no arguments. +.Pp +.Nm +supports only well-formed XML DocBook V4.x until V5.1. +SGML DocBook documents may be parsed unless they contain SGML-specific +constructs, such as empty end tags +.Li . .Sh EXIT STATUS .Ex -std .Sh EXAMPLES @@ -61,6 +67,11 @@ was written by The .Nm utility is experimental. -As such, only a small subset of the +As such, only a modest subset of the .Aq refentry domain is accepted. +.Pp +The output +.Xr mdoc 7 +could be much nicer: trailing spaces, superfluous space removal, +new-line new-sentence, and other niceties are not used. Index: docbook2mdoc.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/docbook2mdoc/docbook2mdoc.c,v retrieving revision 1.30 retrieving revision 1.31 diff -Ldocbook2mdoc.c -Ldocbook2mdoc.c -u -p -r1.30 -r1.31 --- docbook2mdoc.c +++ docbook2mdoc.c @@ -335,15 +335,17 @@ xml_elem_start(void *arg, const XML_Char if (0 == strcmp(*att, attrkeys[key])) break; if (ATTRKEY__MAX == key) { - fprintf(stderr, "%s:%zu:%zu: unknown " - "attribute \"%s\"\n", ps->fname, + fprintf(stderr, "%s:%zu:%zu: warning: " + "unknown attribute \"%s\"\n", + ps->fname, XML_GetCurrentLineNumber(ps->xml), XML_GetCurrentColumnNumber(ps->xml), *att); continue; } else if ( ! isattrkey(node, key)) { - fprintf(stderr, "%s:%zu:%zu: bad " - "attribute \"%s\"\n", ps->fname, + fprintf(stderr, "%s:%zu:%zu: warning: " + "bad attribute \"%s\"\n", + ps->fname, XML_GetCurrentLineNumber(ps->xml), XML_GetCurrentColumnNumber(ps->xml), *att); @@ -353,8 +355,9 @@ xml_elem_start(void *arg, const XML_Char if (0 == strcmp(*(att + 1), attrvals[val])) break; if (ATTRVAL__MAX != val && ! isattrval(key, val)) { - fprintf(stderr, "%s:%zu:%zu: bad " - "value \"%s\"\n", ps->fname, + fprintf(stderr, "%s:%zu:%zu: warning: " + "bad attribute value \"%s\"\n", + ps->fname, XML_GetCurrentLineNumber(ps->xml), XML_GetCurrentColumnNumber(ps->xml), *(att + 1)); --- as.xml +++ /dev/null @@ -1,32 +0,0 @@ - - -Reference Pages - - - - GNU as - as - the portable GNU assembler - - SYNOPSIS - ... - - DESCRIPTION - ... - - - - - - awk - pattern scanning and text processing language - - SYNOPSIS - ... - - DESCRIPTION - ... - - - Index: index.xml =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/docbook2mdoc/index.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -Lindex.xml -Lindex.xml -u -p -r1.6 -r1.7 --- index.xml +++ index.xml @@ -35,7 +35,7 @@

The docbook2mdoc utility is a converter from DocBook into DocBook V4.x and v5.x XML into mdoc. Unlike most DocBook utilities, it's a standalone ISC-licensed ISO C utility @@ -44,23 +44,17 @@ installed by default on most systems.

- docbook2mdoc is very experimental: it probably won't work with your manual - without improvement. - However, it does work with the DocBook reference manuals (minimally rendered here with mandoc -Thtml): printf, ls, as, iovec. -

-

- Contact Kristaps with questions, but please make sure any formatting issue - hasn't already been covered in the manual. + docbook2mdoc is experimental: it still has many missing elements. + However, it works with the DocBook reference examples and documents found in the wild. + Contact Kristaps with questions or missing nodes; or better yet, download + the source and add new elements yourself as described in the README.

New in version @VERSION@...

- Allow for more node types as found in doclifter output. - Add rudimentary support for <table> as a list-of-lists. - Still lots of work to be done before accepting enough DocBook to be useful... + Now supports all tags as found in the RefDB tool, which claims to + have extensive DocBook documentation.