William M. Brack | 2ad1dff | 2003-11-15 10:35:20 +0000 | [diff] [blame^] | 1 | Notes on the libxml2 Documentation |
| 2 | Prepared by: William Brack <wbrack@mmm.com.hk> |
| 3 | |
| 4 | After spending a lot of time tracing through Makefile.am, some Python |
| 5 | scripts and some xsl scripts and xml files, I thought it might be good |
| 6 | to save others some time by setting down the basic information about how |
| 7 | the library documentation is created. I intend to enhance this process, |
| 8 | but will keep this document up-to-date for everyone's information. Note |
| 9 | that this document does not apply to the subdirectory "tutorial", which |
| 10 | is separately maintained by John Fleck. |
| 11 | |
| 12 | There are a relatively small number of files which form the "core" of |
| 13 | the document directory. All the other files in the directory can be re- |
| 14 | generated using the information present in these core files, plus the |
| 15 | actual library source files (*.[ch]) in the parent directory "../" and |
| 16 | it's descendants include and include/libxml. These core files, together |
| 17 | with a brief description of each, are as follows:- |
| 18 | |
| 19 | xml.html The "main page", manually produced by Daniel Veillard |
| 20 | news.html The latest news, extracted from xml.html by site.xsl |
| 21 | |
| 22 | benchmark.gif Illustrations used for the "main page" and subsidiaries |
| 23 | gnome2.png ------- |
| 24 | Libxml2-Logo-180x168.gif | |
| 25 | libxml.gif | |
| 26 | linus.gif | |
| 27 | redhat.gif | |
| 28 | structure.gif \ / |
| 29 | w3c.png - |
| 30 | |
| 31 | apibuild.py Python script which generates the file libxml2-api.xml |
| 32 | parsedecl.py Python secipt which generates the file libxml2-refs.xml |
| 33 | |
| 34 | api.xsl xslt script to generate API cross-references APIchunk*.html |
| 35 | using information from libxml2-api.xml and libxml2-refs.xml |
| 36 | news.xsl xslt script to generate ../NEWS from news.html |
| 37 | site.xsl xslt script imported by api.xsl, generates most top-level |
| 38 | pages from news.html |
| 39 | xsa.xsl xslt script to generate libxml.xsa from news.html |
| 40 | |
| 41 | xmlcatalog.1 Man page for xml catalogs |
| 42 | xmllint.1 Man page for xmllint program |
| 43 | |
| 44 | libxml-doc.el Control script for displaying docs under emacs |
| 45 | |
| 46 | |
| 47 | Given the above files, the generation of the complete documentation (as |
| 48 | provided on the web by xmlsoft.org) can be created with the following steps: |
| 49 | |
| 50 | NOTE: Steps 1 through 5 are performed with the command "make rebuild"; |
| 51 | Step 6 must be accomplished manually. |
| 52 | Steps 7 and 8 are performed with the command "make web" |
| 53 | |
| 54 | 1) Generate libxml-decl.txt, libxml-decl-list.txt and libxml-sections.txt: |
| 55 | gtkdoc-scan --module=libxml --source-dir=../ \ |
| 56 | --ignore-headers="acconfig.h config.h win32config.h trio.h triostr.h |
| 57 | triop.h config-m ac.h XMLTestPrefix2.h XMLTestPrefix.h |
| 58 | triodef.h trionan.h xlink.h libxml.h libx ml2-py.h |
| 59 | libxml_wrap.h" |
| 60 | |
| 61 | These three files are used by the gdk-doc routines in the following steps. |
| 62 | |
| 63 | 2) Generate the sgml documentation in the subdirectory "tmpl": |
| 64 | gtkdoc-mktmpl --module=libxml |
| 65 | |
| 66 | 3) Generate the xml documentation in the subdirectory "xml": |
| 67 | gtkdoc-mkdb --module=libxml --source-dir=../ --output-format=xml \ |
| 68 | --main-sgml-file=gnome-xml.xml |
| 69 | |
| 70 | This also generates the file gnome-xml.xml. |
| 71 | Note that, in order to produce "readable" documentation, the file |
| 72 | gnome-xml.xml should be manually edited in order to put in appropriate |
| 73 | titles. |
| 74 | |
| 75 | 4) Generate the main html documentation in the subdirectory "html": |
| 76 | cd html |
| 77 | gtkdoc-mkhtml libxml ../gnome-xml.xml |
| 78 | cd ../ |
| 79 | |
| 80 | Note that the file index.html is really not suitable, so a manual |
| 81 | substitution of a generic index is done. |
| 82 | |
| 83 | 5) Generate libxml2-api.xml: |
| 84 | ./apibuild.py |
| 85 | |
| 86 | This script is a more recent addition to the documentation generation. |
| 87 | Instead of using the information from the gtk-doc routines, it actually |
| 88 | re-processes all the the library source files, extracting information |
| 89 | about the api (exported procedures and symbols, together with information |
| 90 | from the source comments within these). It produces an xml file which |
| 91 | contains all of this information, "libxml2-api.xml". |
| 92 | |
| 93 | 6) Generate libxml2-refs.xml: |
| 94 | ./parsedecl.py |
| 95 | |
| 96 | This script uses the *.txt files generated by Step 1, together with the |
| 97 | files in the subdirectory xml produced in Step 3, and produces the summary |
| 98 | xml file "libxml2-refs.xml". Historically, it also used to produce |
| 99 | information on the api's in the file "libxml2-api.xml", but that step is |
| 100 | now being done by a separate script. |
| 101 | |
| 102 | 7) Generate the site's main page: |
| 103 | xsltproc --nonet --html --output index.html site.xsl xml.html |
| 104 | |
| 105 | All of the "top-level" pages (except xmlreader.html and guidelines.html) |
| 106 | which have navigation framing, are generated from this step |
| 107 | |
| 108 | 8) Generate the contents and cross-referencing pages: |
| 109 | xsltproc --nonet --html api.xsl xml.html |
| 110 | |
| 111 | 9) Generate the NEWS file in the top directory: |
| 112 | xsltproc --nonet --output ../NEWS news.xsl news.html |
| 113 | |
| 114 | 10)Generate the XML Software Autoupdate file libxml2.xsa: |
| 115 | xsltproc --nonet --output libxml2.xsa xsa.xsl news.html |
| 116 | |
| 117 | 11)Manually generate xmlcatalog.1 and xmllint.1 using manpages/docbook.xsl |
| 118 | stylesheet in docbook stylesheets |
| 119 | |
| 120 | After these steps have been done, the documentation is complete. |
| 121 | The search engine is then set up using the script index.py, using |
| 122 | libxml2-api.xml, the HTML web pages generated above, and the HTML |
| 123 | mailing list archives at gnome.org. |
| 124 | |
| 125 | |
| 126 | Last update: 15 November 2003 |
| 127 | |