From: Zhanna Tsitkov Date: Tue, 28 Jun 2011 17:36:52 +0000 (+0000) Subject: Add instructions for adding the API reference documentation to Sphinx Kerberos docume... X-Git-Tag: krb5-1.10-alpha1~376 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1341e96bf74a6b1ef1796a8778cb25e4268605c1;p=krb5.git Add instructions for adding the API reference documentation to Sphinx Kerberos documentation project git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24997 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/doc/rst_tools/README b/doc/rst_tools/README new file mode 100644 index 000000000..242583b29 --- /dev/null +++ b/doc/rst_tools/README @@ -0,0 +1,61 @@ +How to deploy the Doxygen output in Sphinx project. +==================================================== + +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. + +Pre-requisites: +- python 2.5+ with Cheetah, lxml and xml extension modules installed; +- For part B only: + - Sphinx “doxylink” extension; + - Doxygen HTML output + + +Part A: Transforming Doxygen XML output into reStructuredText (rst) without the bridge to Doxygen HTML output. + +1. Delete lines containing text "Doxygen reference" from the template files func_document.tmpl and type_document.tmpl; + +2. In the Doxygen configuration file set GENERATE_XML to YES. Generate Doxygen XML output; + +3. Suppose the Doxygen XML output is located in doxy_xml_dir and the desired output directory is rst_dir. + Run: + python doxy.py –i doxy_xml_dir –o rst_dir –t func + 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 + + Run: + python doxy.py –i doxy_xml_dir –o rst_dir –t typedef + It is similar to the API function conversion, but for data types. The result will be stored under rst_dir/types directory + + Alternatively, running + python doxy.py –i doxy_xml_dir –o rst_dir + or + python doxy.py –i doxy_xml_dir –o rst_dir -t all + converts Doxygen XML output into reStructuredText format files both for API functions and data types; + +4. In krb_appldev/index.rst add the following section to point to the API references: + + .. toctree:: + :maxdepth: 1 + + refs/index.rst + +5. Copy the content of rst_dir into krb_appldev/refs/api/ directory and rst_dir/types into krb_appldev/refs/types directory; + +6. Rebuild Sphinx source: + sphinx-build source_dir build_dir + + + + +Part B: Transforming Doxygen XML output into reStructuredText with the bridge to Doxygen HTML output. + +1. In the Doxygen configuration file set option GENERATE_XML to YES. Also, set option GENERATE_TAGFILE to create a Doxygen tag file. For example, GENERATE_TAGFILE = /tmp/krb5doxy.tag. Generate Doxygen XML output; + +2. Modify Sphinx conf.py file to point to the “doxylink” extension and Doxygen tag file: + +extensions = ['sphinx.ext.autodoc', 'sphinxcontrib.doxylink'] +doxylink = { ' krb5doxy' : ('/tmp/krb5doxy.tag, ' doxy_html_dir ') } + +where doxy_html_dir is the location of the Doxygen HTML output + +3. Continue with steps 3 - 6 of Part A. + diff --git a/doc/rst_tools/docmodel.py b/doc/rst_tools/docmodel.py index 6db5b1db7..13c3d349c 100644 --- a/doc/rst_tools/docmodel.py +++ b/doc/rst_tools/docmodel.py @@ -1,7 +1,25 @@ ''' -Created on Nov 9, 2010 - -@author: tsitkova + Copyright 2011 by the Massachusetts + Institute of Technology. All Rights Reserved. + + Export of this software from the United States of America may + require a specific license from the United States Government. + It is the responsibility of any person or organization contemplating + export to obtain such a license before exporting. + + WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + distribute this software and its documentation for any purpose and + without fee is hereby granted, provided that the above copyright + notice appear in all copies and that both that copyright notice and + this permission notice appear in supporting documentation, and that + the name of M.I.T. not be used in advertising or publicity pertaining + to distribution of the software without specific, written prior + permission. Furthermore if you modify this software you must label + your software as modified software and not distribute it in such a + fashion that it might be confused with the original M.I.T. software. + M.I.T. makes no representations about the suitability of + this software for any purpose. It is provided "as is" without express + or implied warranty. ''' import re diff --git a/doc/rst_tools/func_document.tmpl b/doc/rst_tools/func_document.tmpl index 830e5fc24..6c3436142 100644 --- a/doc/rst_tools/func_document.tmpl +++ b/doc/rst_tools/func_document.tmpl @@ -6,7 +6,7 @@ $title #echo ''.join(['=']*len($title)) # -:polyvox:`Doxygen reference to $function.name <$function.name>` +:krb5doxy:`Doxygen reference to $function.name <$function.name>` .. diff --git a/doc/rst_tools/type_document.tmpl b/doc/rst_tools/type_document.tmpl index 17a8b8119..de92bcca5 100644 --- a/doc/rst_tools/type_document.tmpl +++ b/doc/rst_tools/type_document.tmpl @@ -14,7 +14,7 @@ $title -:polyvox:`Doxygen reference to $composite.name <$composite.name>` +:krb5doxy:`Doxygen reference to $composite.name <$composite.name>` .. .. c:type:: $composite.name