[glibmm] gmmproc: Don't include C code examples found in the XML docs.



commit fabaf0ff4f93d530a0c45d10426f8b635e201daf
Author: Josà Alburquerque <jaalburqu svn gnome org>
Date:   Tue Oct 25 17:08:54 2011 -0400

    gmmproc: Don't include C code examples found in the XML docs.
    
    	* tools/pm/DocsParser.pm (lookup_documentation): Remove the C example
    	code from the attained documentation of the specified function.  Print
    	a warning that the example code has been removed if that is the
    	case.  Include the function name in the warning so that it is known
    	where the examples are in case it is convenient to translate them.
    	(convert_tags_to_doxygen): No longer convert tags and symbols that
    	signal example code to Doxygen format since they are removed with the
    	example code.
    
    	Bug #650544

 ChangeLog              |   15 +++++++++++++++
 tools/pm/DocsParser.pm |   12 ++++++++++--
 2 files changed, 25 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e345bfe..20ce69e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2011-10-25  Josà Alburquerque  <jaalburqu svn gnome org>
+
+	gmmproc: Don't include C code examples found in the XML docs.
+
+	* tools/pm/DocsParser.pm (lookup_documentation): Remove the C example
+	code from the attained documentation of the specified function.  Print
+	a warning that the example code has been removed if that is the
+	case.  Include the function name in the warning so that it is known
+	where the examples are in case it is convenient to translate them.
+	(convert_tags_to_doxygen): No longer convert tags and symbols that
+	signal example code to Doxygen format since they are removed with the
+	example code.
+
+	Bug #650544
+
 2011-10-25  Murray Cumming  <murrayc murrayc com>
 
 	giomm/wrap_init.h: Remove the glibmm.h include from here too.
diff --git a/tools/pm/DocsParser.pm b/tools/pm/DocsParser.pm
index 1a0b604..4900793 100644
--- a/tools/pm/DocsParser.pm
+++ b/tools/pm/DocsParser.pm
@@ -264,6 +264,15 @@ sub lookup_documentation($$)
   # Escape the space after "i.e." or "e.g." in the brief description.
   $text =~ s/^([^.]*\b(?:i\.e\.|e\.g\.))\s/$1\\ /;
 
+  # Remove C example code.
+  my $example_removals =
+    ($text =~ s"<informalexample>.*?</informalexample>""sg);
+
+  $example_removals += ($text =~ s"\|\[.*?]\|""sg);
+
+  print STDERR "gmmproc: $functionName(): Example code discarded.\n"
+    if ($example_removals);
+
   # Convert to Doxygen-style comment.
   $text =~ s/\n/\n${DocsParser::commentMiddleStart}/g;
   $text =  $DocsParser::commentStart . $text;
@@ -374,8 +383,7 @@ sub convert_tags_to_doxygen($)
     s"^Note ?\d?: "\ note "mg;
 
     s"</?programlisting>""g;
-    s"<informalexample>|\|\["\ code"g;
-    s"</informalexample>|]\|"\ endcode"g;
+
     s"<!>""g;
 
     # Remove all link tags.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]