octave-maintainers
[Top][All Lists]
Advanced

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

Re: [changeset] don't remove whitespace within @example in docstrings


From: Thorsten Meyer
Subject: Re: [changeset] don't remove whitespace within @example in docstrings
Date: Sat, 08 Nov 2008 10:46:57 +0100
User-agent: Mozilla-Thunderbird 2.0.0.17 (X11/20081018)

Thorsten Meyer wrote:
> Hi,
> 
> during the build process of octave, the documentation strings within the .m 
> files are extracted by
> the script scripts/mkdoc. This scripts also removes white space before 
> @-commands at the beginning
> of lines. The script also removes white space before @result{}, which 
> distorts the display of the
> @examples in the documentations strings.
> 
> Included, you will find a changeset that fixes mkdoc, such that it no longer 
> eats white space
> within @example environments.
Oops, I forgot the attachement. Here it is. And thanks for the hint, Shai.

Thorsten
# HG changeset patch
# User Thorsten Meyer <address@hidden>
# Date 1226099532 -3600
# Node ID 66d66287bca47ad1b7e92f99593b301672c8de63
# Parent  bd2a8ae3c15ad008cedef080cc5d5eed415bb364
do not eat white space within @example environments of docstrings

diff -r bd2a8ae3c15a -r 66d66287bca4 ChangeLog
--- a/ChangeLog Sat Nov 08 00:05:40 2008 +0100
+++ b/ChangeLog Sat Nov 08 00:12:12 2008 +0100
@@ -1,3 +1,7 @@
+2008-11-08  Thorsten Meyer  <address@hidden>
+
+        * Makeconf.in: export PERL variable for use in scripts/mkdoc
+        
 2008-10-30  David Bateman  <address@hidden>
 
        * NEWS: Minor update to document improved indexing code.
diff -r bd2a8ae3c15a -r 66d66287bca4 Makeconf.in
--- a/Makeconf.in       Sat Nov 08 00:05:40 2008 +0100
+++ b/Makeconf.in       Sat Nov 08 00:12:12 2008 +0100
@@ -33,6 +33,8 @@
 export FIND
 
 PERL = @PERL@
+export PERL
+
 PYTHON = @PYTHON@
 
 GNUPLOT = @GNUPLOT@
diff -r bd2a8ae3c15a -r 66d66287bca4 scripts/ChangeLog
--- a/scripts/ChangeLog Sat Nov 08 00:05:40 2008 +0100
+++ b/scripts/ChangeLog Sat Nov 08 00:12:12 2008 +0100
@@ -1,3 +1,8 @@
+2008-11-07  Thorsten Meyer  <address@hidden>
+
+        * mkdoc: do not remove white space before @ within @example
+          environment
+
 2008-11-05  Thorsten Meyer  <address@hidden>
 
         * plot/subplot.m: fix texi bug
diff -r bd2a8ae3c15a -r 66d66287bca4 scripts/mkdoc
--- a/scripts/mkdoc     Sat Nov 08 00:05:40 2008 +0100
+++ b/scripts/mkdoc     Sat Nov 08 00:12:12 2008 +0100
@@ -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/address@hidden/address@hidden/;
+                 s/address@hidden/address@hidden/;
+                 $i_am_in_example = 1 if /address@hidden/;
+                 $i_am_in_example = 0 if /address@hidden/;
+                 print;
+               }'  
 else
   echo "gethelp program seems to be missing!" 1>&2
   exit 1

reply via email to

[Prev in Thread] Current Thread [Next in Thread]