diff scripts/mkdoc @ 8444:c3ac9f2772cd

do not eat white space within @example environments of docstrings
author Thorsten Meyer <thorsten.meyier@gmx.de>
date Mon, 05 Jan 2009 10:54:22 +0100
parents 4270ded9ddc6
children dd52e541418b
line wrap: on
line diff
--- a/scripts/mkdoc
+++ b/scripts/mkdoc
@@ -34,9 +34,16 @@
 ### Edit those files instead and run make to update this file.
 
 EOF
-  find $d -name '*.m' | \
-    sed "s,\(.*\)/\(.*\)\.m,./gethelp \2 < & | sed 's/^ *@/@/'," | \
-    /bin/sh
+  $FIND $d -name '*.m' | \
+    $PERL -ne 'm{(.*)/(.*)\.m};
+               for (qx{./gethelp $2 < $_}) {
+                 s/^\s+\@/\@/ unless $i_am_in_example;
+                 s/^\s+\@group/\@group/;
+                 s/^\s+\@end\s+group/\@end\s+group/;
+                 $i_am_in_example = 1 if /\s*\@example/;
+                 $i_am_in_example = 0 if /\s*\@end\s+example/;
+                 print;
+               }'  
 else
   echo "gethelp program seems to be missing!" 1>&2
   exit 1