=================================================================== RCS file: /cvs/docbook2mdoc/README,v retrieving revision 1.5 retrieving revision 1.7 diff -u -p -r1.5 -r1.7 --- docbook2mdoc/README 2019/04/11 04:23:22 1.5 +++ docbook2mdoc/README 2019/04/14 12:38:33 1.7 @@ -1,4 +1,4 @@ -$Id: README,v 1.5 2019/04/11 04:23:22 schwarze Exp $ +$Id: README,v 1.7 2019/04/14 12:38:33 schwarze Exp $ Here's a quick note on how to add new DocBook elements. @@ -13,9 +13,10 @@ For these, you will have to look at 4.5 documentation https://tdg.docbook.org/tdg/4.5/foo.html -Add one "struct element" initializer to the elements[] array in the -file parse.c, containing the name of element as it appears in DocBook -documents and the "enum nodeid" constant of the node to be generated. +Add one "struct alias" initializer to the aliases[] array in the +file parse.c *or* one "struct nodeprop" initializer to the properties[] +array in the file node.c, but not both. The first struct member is +the name of the element as it appears in DocBook documents. There are several special cases: * If docbook2mdoc(1) never needs to produce any output for the @@ -47,9 +48,9 @@ There are several special cases: one explicit formatting decision based on the presence, absence, or content of the element - add an enum constant for the new node to the declaration of "enum nodeid" in the file node.h. - Preserve the alphabetic ordering. + Use properties[] in node.c and preserve the alphabetic ordering. Add such a constant if only if the code will use it at least at - one place in addition to the definition of the elements[] array. + one place. In the latter case, implement formatting in the file docbook2mdoc.c. @@ -68,13 +69,14 @@ include: * Nodes with complex formatting requirements call their own, dedicated pnode_print*() formatting functions. - These functions are ordered roughly as follows: + For historical reasons, these functions are ordered roughly as follows: 1. paragraphs 2. sections 3. functions and mathematics 4. semantic markup for command line utilities 5. various semantic markup - 6. structural markup like lists and tables + 6. prologue and top level structures + 7. structural markup like lists and tables Such functions often contain their own loops over children and remove the children with pnode_unlinksub() at the end. But in some cases, it is alternatively possible to let the common loop