Annotation of docbook2mdoc/README, Revision 1.1
1.1 ! kristaps 1: $Id$
! 2:
! 3: Here's a quick note on how to add new DocBook elements.
! 4:
! 5: First, look up the element in the DocBook reference. For element <foo>, this is usually:
! 6:
! 7: http://docbook.org/tdg51/en/html/foo.html
! 8:
! 9: Add the alpha-ordered node (NODE_FOO) to extern.h.
! 10:
! 11: Next, add rules.c isparent() rule. This is the hard part. First,
! 12: create a top-level switch statement for NODE_FOO. Create a white-list
! 13: of switch cases beneath that corresponding to each "These elements
! 14: contain foo":
! 15:
! 16: switch (parent) {
! 17: case (NODE_BAR):
! 18: case (NODE_BAZ):
! 19: return(1);
! 20: default:
! 21: break;
! 22: }
! 23: return(0);
! 24:
! 25: Next, go through the "The following elements occur in foo" and add a
! 26: "case (NODE_FOO)" to each of those elements' switches.
! 27:
! 28: Now the hard work is finished!
! 29:
! 30: Next, add the name and whether it admits text to docbook2mdoc.c's
! 31: "nodes" structure array.
! 32:
! 33: Finally, modify print_pnode() with your new entry. Use similar nodes as
! 34: a reference. (NOTE: if it's an inline like, say, NODE_EMPHASIS, then
! 35: remember to add the node to the postfix switch statement!)
CVSweb