1*7f2fe78bSCy SchubertHow to deploy the Doxygen output in Sphinx project. 2*7f2fe78bSCy Schubert==================================================== 3*7f2fe78bSCy Schubert 4*7f2fe78bSCy SchubertThe text below is meant to give the instructions on how to incorporate MIT Kerberos API reference documentation into Sphinx document hierarchy. The Sphinx API documentation can be constructed with (Part B) or without (Part A) the bridge to the original Doxygen HTML output. 5*7f2fe78bSCy Schubert 6*7f2fe78bSCy SchubertPre-requisites: 7*7f2fe78bSCy Schubert- python 2.5+ with Cheetah, lxml and xml extension modules installed; 8*7f2fe78bSCy Schubert- For part B only: 9*7f2fe78bSCy Schubert - Sphinx "doxylink" extension; 10*7f2fe78bSCy Schubert - Doxygen HTML output 11*7f2fe78bSCy Schubert 12*7f2fe78bSCy Schubert 13*7f2fe78bSCy SchubertPart A: Transforming Doxygen XML output into reStructuredText (rst) without the bridge to Doxygen HTML output. 14*7f2fe78bSCy Schubert 15*7f2fe78bSCy Schubert1. Delete lines containing text "Doxygen reference" from the template files func_document.tmpl and type_document.tmpl; 16*7f2fe78bSCy Schubert 17*7f2fe78bSCy Schubert2. In the Doxygen configuration file set GENERATE_XML to YES. Generate Doxygen XML output; 18*7f2fe78bSCy Schubert 19*7f2fe78bSCy Schubert3. Suppose the Doxygen XML output is located in doxy_xml_dir and the desired output directory is rst_dir. 20*7f2fe78bSCy Schubert Run: 21*7f2fe78bSCy Schubert python doxy.py -i doxy_xml_dir -o rst_dir -t func 22*7f2fe78bSCy Schubert This will result in the storing of the API function documentation files in rst format in the rst_dir. The file names are constructed based on the function name. For example, the file for krb5_build_principal() will be krb5_build_principal.rst 23*7f2fe78bSCy Schubert 24*7f2fe78bSCy Schubert Run: 25*7f2fe78bSCy Schubert python doxy.py -i doxy_xml_dir -o rst_dir -t typedef 26*7f2fe78bSCy Schubert It is similar to the API function conversion, but for data types. The result will be stored under rst_dir/types directory 27*7f2fe78bSCy Schubert 28*7f2fe78bSCy Schubert Alternatively, running 29*7f2fe78bSCy Schubert python doxy.py -i doxy_xml_dir -o rst_dir 30*7f2fe78bSCy Schubert or 31*7f2fe78bSCy Schubert python doxy.py -i doxy_xml_dir -o rst_dir -t all 32*7f2fe78bSCy Schubert converts Doxygen XML output into reStructuredText format files both for API functions and data types; 33*7f2fe78bSCy Schubert 34*7f2fe78bSCy Schubert4. In appdev/index.rst add the following section to point to the API references: 35*7f2fe78bSCy Schubert 36*7f2fe78bSCy Schubert .. toctree:: 37*7f2fe78bSCy Schubert :maxdepth: 1 38*7f2fe78bSCy Schubert 39*7f2fe78bSCy Schubert refs/index.rst 40*7f2fe78bSCy Schubert 41*7f2fe78bSCy Schubert5. Copy the content of rst_dir into appdev/refs/api/ directory and rst_dir/types into appdev/refs/types directory; 42*7f2fe78bSCy Schubert 43*7f2fe78bSCy Schubert6. Rebuild Sphinx source: 44*7f2fe78bSCy Schubert sphinx-build source_dir build_dir 45*7f2fe78bSCy Schubert 46*7f2fe78bSCy Schubert 47*7f2fe78bSCy Schubert 48*7f2fe78bSCy Schubert 49*7f2fe78bSCy SchubertPart B: Bridge to Doxygen HTML output. 50*7f2fe78bSCy Schubert 51*7f2fe78bSCy Schubert1. Transform Doxygen XML output into reStructuredText. 52*7f2fe78bSCy Schubert In src/Doxygen configuration file request generation of the tag file and XML output: 53*7f2fe78bSCy Schubert GENERATE_TAGFILE = krb5doxy.tag 54*7f2fe78bSCy Schubert GENERATE_XML = YES 55*7f2fe78bSCy Schubert 56*7f2fe78bSCy Schubert2. Modify Sphinx conf.py file to point to the "doxylink" extension and Doxygen tag file: 57*7f2fe78bSCy Schubert extensions = ['sphinx.ext.autodoc', 'sphinxcontrib.doxylink'] 58*7f2fe78bSCy Schubert doxylink = { ' krb5doxy' : ('/tmp/krb5doxy.tag, ' doxy_html_dir ') } 59*7f2fe78bSCy Schubert 60*7f2fe78bSCy Schubert where doxy_html_dir is the location of the Doxygen HTML output 61*7f2fe78bSCy Schubert 62*7f2fe78bSCy Schubert3. Continue with steps 3 - 6 of Part A. 63