[glibmm] gmmproc: Some conversion fixes.



commit 9a534e4a3fbb57035cb5284c42bea02a91f80942
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Mon Nov 22 16:25:52 2010 -0500

    	gmmproc: Some conversion fixes.
    
    	* tools/pm/DocsParser.pm (convert_docs_to_cpp): Convert occurances of
    	'`' to the variable '__BT__' defined in base.m4 which safely produces
    	the same character without causing M4 processing errors.
    	(convert_tags_to_doxygen): Add a substition for the
    	<constant></constant> gtk-doc tag to the equivalent Doxygen <tt></tt>
    	tag.  Also use '<' instead of '&lt;' and '>' instead of '&gt;' in the
    	substitutions because otherwise the tags are not recognized.

 ChangeLog              |   12 ++++++++++++
 tools/pm/DocsParser.pm |   26 ++++++++++++++++----------
 2 files changed, 28 insertions(+), 10 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 218ef88..20db9c2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2010-11-22  José Alburquerque  <jaalburqu svn gnome org>
 
+	gmmproc: Some conversion fixes.
+
+	* tools/pm/DocsParser.pm (convert_docs_to_cpp): Convert occurances of
+	'`' to the variable '__BT__' defined in base.m4 which safely produces
+	the same character without causing M4 processing errors.
+	(convert_tags_to_doxygen): Add a substition for the
+	<constant></constant> gtk-doc tag to the equivalent Doxygen <tt></tt>
+	tag.  Also use '<' instead of '&lt;' and '>' instead of '&gt;' in the
+	substitutions because otherwise the tags are not recognized.
+
+2010-11-22  José Alburquerque  <jaalburqu svn gnome org>
+
 	Gio::DBusConnection: Add emit_signal().
 
 	* gio/src/dbusconnection.{ccg,hg}: Add emit_signal() wrapping
diff --git a/tools/pm/DocsParser.pm b/tools/pm/DocsParser.pm
index 430cacb..ba178fe 100644
--- a/tools/pm/DocsParser.pm
+++ b/tools/pm/DocsParser.pm
@@ -335,6 +335,11 @@ sub convert_docs_to_cpp($$)
 
     $$text =~ s/\bX\s+Window\b/X&nbsp;\%Window/g;
     $$text =~ s/\bWindow\s+manager/\%Window manager/g;
+
+    # This is so that if there is a '`' in the docs it doesn't cause a
+    # problem when M4 processing occurs.  __BT__ is a variable defined in the
+    # base.m4 file that produces a '`' without M4 errors.
+    $$text =~ s/`/__BT__/g;
 #  }
 }
 
@@ -346,9 +351,10 @@ sub convert_tags_to_doxygen($)
   for($$text)
   {
     # Replace format tags.
-    s"&lt;(/?)emphasis&gt;"<$1em>"g;
-    s"&lt;(/?)literal&gt;"<$1tt>"g;
-    s"&lt;(/?)function&gt;"<$1tt>"g;
+    s"<(/?)emphasis>"<$1em>"g;
+    s"<(/?)literal>"<$1tt>"g;
+    s"<(/?)constant>"<$1tt>"g;
+    s"<(/?)function>"<$1tt>"g;
 
     # Some argument names are suffixed by "_" -- strip this.
     # gtk-doc uses @thearg, but doxygen uses @a thearg.
@@ -359,21 +365,21 @@ sub convert_tags_to_doxygen($)
     s" \ a (throws|param)" \ $1"g;
     s"^Note ?\d?: "\ note "mg;
 
-    s"&lt;/?programlisting&gt;""g;
-    s"&lt;informalexample&gt;"\ code"g;
-    s"&lt;/informalexample&gt;"\ endcode"g;
-    s"&lt;!&gt;""g;
+    s"</?programlisting>""g;
+    s"<informalexample>"\ code"g;
+    s"</informalexample>"\ endcode"g;
+    s"<!>""g;
 
     # Remove all link tags.
-    s"&lt;/?u?link[^&]*&gt;""g;
+    s"</?u?link[^&]*>""g;
 
     # Remove all para tags (from tmpl sgml files).
-    s"&lt;/?para&gt;""g;
+    s"</?para>""g;
 
     # Use our Doxygen @newin alias:
     s/\bSince:\s*(\d+)\.(\d+)\b/\ newin{$1,$2}/g;
 
-    s"\b-&gt;\b"->"g;
+    s"\b->\b"->"g;
 
     # Doxygen is too dumb to handle &mdash;
     s"&mdash;" \ htmlonly&mdash;\ endhtmlonly "g;



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