svn rev #25811: trunk/doc/rst_tools/

tsitkova@MIT.EDU tsitkova at MIT.EDU
Tue Apr 17 14:07:07 EDT 2012


http://src.mit.edu/fisheye/changelog/krb5/?cs=25811
Commit By: tsitkova
Log Message:
Translate @version Doxygen markup into rst format.



Changed Files:
U   trunk/doc/rst_tools/docmodel.py
U   trunk/doc/rst_tools/doxybuilder_funcs.py
U   trunk/doc/rst_tools/func_document.tmpl
Modified: trunk/doc/rst_tools/docmodel.py
===================================================================
--- trunk/doc/rst_tools/docmodel.py	2012-04-17 17:58:56 UTC (rev 25810)
+++ trunk/doc/rst_tools/docmodel.py	2012-04-17 18:07:07 UTC (rev 25811)
@@ -120,6 +120,7 @@
         self.warn_description = argkw.get('warn_description')
         self.sa_description = argkw.get('sa_description')
         self.notes_description = argkw.get('notes_description')
+        self.version_num = argkw.get('version_num')
         self.short_description = argkw.get('short_description')
         self.long_description = argkw.get('long_description')
         self.deprecated_description = argkw.get('deprecated_description')
@@ -179,6 +180,7 @@
         lines.append('Warning description:\n%s' % self.warn_description)
         lines.append('See also description:\n%s' % self.sa_description)
         lines.append('NOTE description:\n%s' % self.notes_description) 
+        lines.append('Version introduced:\n%s' % self.version_num)
         lines.append('Deprecated description:\n%s' % self.deprecated_description)
         result = '\n'.join(lines)
         

Modified: trunk/doc/rst_tools/doxybuilder_funcs.py
===================================================================
--- trunk/doc/rst_tools/doxybuilder_funcs.py	2012-04-17 17:58:56 UTC (rev 25810)
+++ trunk/doc/rst_tools/doxybuilder_funcs.py	2012-04-17 18:07:07 UTC (rev 25811)
@@ -199,6 +199,7 @@
         warning_description = self._process_warning_description(f_detailed)
         seealso_description = self._process_seealso_description(f_detailed)
         notes_description = self._process_notes_description(f_detailed)
+        f_version = self._process_version_description(f_detailed)
         deprecated_description = self._process_deprecated_description(f_detailed)
         param_description_map = self.process_parameter_description(f_detailed)
         f_definition = node.children['definition'][0].getContent()
@@ -214,6 +215,7 @@
                           'warn_description': warning_description,
                           'notes_description': notes_description,
                           'short_description': f_brief,
+                          'version_num': f_version,
                           'long_description': detailed_description,
                           'deprecated_description': deprecated_description,
                           'parameters': list()}
@@ -475,6 +477,29 @@
                     result = it.walk(decorators, 1)
         return result
 
+    def return_version_decorator(self, node, value):
+        if node.name == 'simplesect':
+            if node.attributes['kind'] == 'version':
+                return value
+        else:
+            return None
+
+    def _process_version_description(self, node):
+        result = None
+        para = node.children.get('para')
+        if para is not None:
+            for p in para:
+                simplesect_list = p.children.get('simplesect')
+                if simplesect_list is None:
+                    continue
+                for it in simplesect_list:
+                    decorators = {'default': self.return_version_decorator,
+                                  'para': self.paragraph_content_decorator}
+                    result = it.walk(decorators, 1)
+                    if result is not None:
+                        return result
+        return result
+
     def return_notes_decorator(self, node, value):
         if node.name == 'simplesect':
             if node.attributes['kind'] == 'note':

Modified: trunk/doc/rst_tools/func_document.tmpl
===================================================================
--- trunk/doc/rst_tools/func_document.tmpl	2012-04-17 17:58:56 UTC (rev 25810)
+++ trunk/doc/rst_tools/func_document.tmpl	2012-04-17 18:07:07 UTC (rev 25811)
@@ -91,3 +91,9 @@
 #end if
 
 #end if
+
+#if $function.version_num is not None
+.. note::
+	$function.version_num
+#end if
+



More information about the cvs-krb5 mailing list