Blame doc/tools/README

Packit fd8b60
How to deploy the Doxygen output in Sphinx project.
Packit fd8b60
====================================================
Packit fd8b60
Packit fd8b60
The 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.
Packit fd8b60
Packit fd8b60
Pre-requisites:
Packit fd8b60
- python 2.5+ with Cheetah, lxml and  xml extension modules installed;
Packit fd8b60
- For part B only:
Packit fd8b60
    -    Sphinx "doxylink" extension;
Packit fd8b60
    -    Doxygen HTML output
Packit fd8b60
Packit fd8b60
Packit fd8b60
Part A:    Transforming Doxygen XML output into reStructuredText (rst)  without the bridge to Doxygen HTML output.
Packit fd8b60
Packit fd8b60
1.    Delete lines containing text "Doxygen reference" from the template files func_document.tmpl and type_document.tmpl;
Packit fd8b60
Packit fd8b60
2.    In the Doxygen configuration file set GENERATE_XML to YES. Generate Doxygen XML output;
Packit fd8b60
Packit fd8b60
3.    Suppose the Doxygen XML output is located in doxy_xml_dir  and the desired output directory is rst_dir.
Packit fd8b60
      Run:
Packit fd8b60
      python doxy.py -i  doxy_xml_dir -o rst_dir -t func
Packit fd8b60
      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
Packit fd8b60
Packit fd8b60
      Run:
Packit fd8b60
      python doxy.py -i  doxy_xml_dir -o rst_dir -t typedef
Packit fd8b60
      It is similar to the API function conversion, but for data types. The result will be stored under rst_dir/types directory
Packit fd8b60
Packit fd8b60
      Alternatively, running
Packit fd8b60
      python doxy.py -i  doxy_xml_dir -o rst_dir
Packit fd8b60
      or
Packit fd8b60
      python doxy.py -i  doxy_xml_dir -o rst_dir -t all
Packit fd8b60
      converts Doxygen XML output into reStructuredText format files both for API functions and data types;
Packit fd8b60
Packit fd8b60
4.    In appdev/index.rst add the following section to point to the API references:
Packit fd8b60
Packit fd8b60
      .. toctree::
Packit fd8b60
          :maxdepth: 1
Packit fd8b60
Packit fd8b60
          refs/index.rst
Packit fd8b60
Packit fd8b60
5.    Copy the content of rst_dir into appdev/refs/api/ directory and rst_dir/types into appdev/refs/types directory;
Packit fd8b60
Packit fd8b60
6.    Rebuild Sphinx source:
Packit fd8b60
      sphinx-build source_dir build_dir
Packit fd8b60
Packit fd8b60
Packit fd8b60
Packit fd8b60
Packit fd8b60
Part B:    Bridge to Doxygen HTML output.
Packit fd8b60
Packit fd8b60
1. Transform Doxygen XML output into reStructuredText.
Packit fd8b60
   In src/Doxygen configuration file request generation of the tag file and XML output:
Packit fd8b60
       GENERATE_TAGFILE       = krb5doxy.tag
Packit fd8b60
       GENERATE_XML           = YES
Packit fd8b60
Packit fd8b60
2. Modify Sphinx conf.py file to point to the "doxylink" extension and Doxygen tag file:
Packit fd8b60
      extensions = ['sphinx.ext.autodoc', 'sphinxcontrib.doxylink']
Packit fd8b60
      doxylink = { ' krb5doxy' : ('/tmp/krb5doxy.tag, ' doxy_html_dir ') }
Packit fd8b60
Packit fd8b60
   where doxy_html_dir is the location of the Doxygen HTML output
Packit fd8b60
Packit fd8b60
3.  Continue with steps 3 - 6 of Part A.