• Dries's avatar
    - Modified version of patch #1482 by Djun: · 78cb1732
    Dries authored
    This patch enables export of books as XML documents.
    The XML is DocBook "at the level of structure", but
    node contents are wrapped as CDATA, since we
    can't be sure that the contents are valid XML.
    Several other bugs/feature requests are also
    addressed with this patch:
    - Fixes bugs
    Should go a long way towards implementing feature request
    It should also be easy to extend this to produce OPML,
    for example.
    - Adds about 170 lines, of which more than 100 are comments
    - Added doxygen comments
    - Made doxygen comment format consistent; fixed minor grammatical slips
    - A proper Doctype and more informative HTML element is generated
    for printer-friendly HTML output.
    - Refactored book_print() to use book_recurse().
    - Refactored book_recurse(). Applies 'visitor' callback functions to nodes
    during weight/title order tree-traversal. The parameterized
    visitor callbacks can be used to generate different kinds of output.
    There are many other kinds of operations on books which can be implemented
    by writing a pre-node/post-node pair of callback functions: word-count/
    statistics gathering, comparison, copying, search and replace...
    - Introduced book_export() which uses book_recurse() to generate
    DocBook-like XML to export book contents in a structured form.
    An md5 hash is computed for each node to help import code to
    decide if a node needs to be updated or not.
book.module 36.3 KB