[BACK]Return to README CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / docbook2mdoc

File: [cvsweb.bsd.lv] / docbook2mdoc / README (download)

Revision 1.1, Wed Apr 2 10:06:14 2014 UTC (9 years, 11 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_0_0_9, VERSION_0_0_8, VERSION_0_0_7

Add <application> and a README for adding new nodes.

$Id: README,v 1.1 2014/04/02 10:06:14 kristaps Exp $

Here's a quick note on how to add new DocBook elements.

First, look up the element in the DocBook reference.  For element <foo>, this is usually:

http://docbook.org/tdg51/en/html/foo.html

Add the alpha-ordered node (NODE_FOO) to extern.h.

Next, add rules.c isparent() rule.  This is the hard part.  First,
create a top-level switch statement for NODE_FOO.  Create a white-list
of switch cases beneath that corresponding to each "These elements
contain foo":

 switch (parent) {
 case (NODE_BAR):
 case (NODE_BAZ):
  return(1);
 default:
  break;
 }
 return(0);

Next, go through the "The following elements occur in foo" and add a
"case (NODE_FOO)" to each of those elements' switches.

Now the hard work is finished!

Next, add the name and whether it admits text to docbook2mdoc.c's
"nodes" structure array.

Finally, modify print_pnode() with your new entry.  Use similar nodes as
a reference.  (NOTE: if it's an inline like, say, NODE_EMPHASIS, then
remember to add the node to the postfix switch statement!)