Mercurial > octave-nkf
diff scripts/mkdoc @ 9927:ecbf1577200c
Distribute DOCSTRINGS to prevent unnecessary documentation rebuild
author | Rik <rdrider0-list@yahoo.com> |
---|---|
date | Sun, 06 Dec 2009 20:40:42 -0800 |
parents | 1506a17832c9 |
children | 4c681ff57bc3 |
line wrap: on
line diff
--- a/scripts/mkdoc Sun Dec 06 20:19:20 2009 -0800 +++ b/scripts/mkdoc Sun Dec 06 20:40:42 2009 -0800 @@ -42,24 +42,28 @@ if [ "$arg" = "--" ]; then prefix="" else - echo "$prefix$arg" | $PERL -n -e 'chop; - $f = "$_"; - next unless m{(.*)/(@|)([^/]*)/(.*)\.m}; - $fcn = "$4"; - if ($2) { - $fcn = "$2$3/$fcn"; - } - for (qx{./gethelp $fcn "$f" < "$f"}) { - s/^\s+\@/\@/ unless $i_am_in_example; + $PERL -w -e ' + unless (@ARGV == 2) { die "Usage: $0 srcdir m_filename" ; } + ($srcdir, $m_fname) = ($ARGV[0], $ARGV[1]); + $full_fname = $srcdir . $m_fname; + exit unless ( $full_fname =~ m{(.*)/(@|)([^/]*)/(.*)\.m} ); + if ($2) { + $fcn = "$2$3/$4"; + } else { + $fcn = $4; + } + $re_srcdir = quotemeta($srcdir); + for (qx{ ./gethelp $fcn "$full_fname" < "$full_fname"} ) { + s/^\s+\@/\@/ unless $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/; + s/^\s+\@end\s+group/\@end group/; + s|\@c $re_srcdir|\@c scripts/|o; + $in_example = (/\s*\@example\b/ .. /\s*\@end\s+example\b/); print; - }' + }' "$prefix" "$arg" fi done else echo "gethelp program seems to be missing!" 1>&2 exit 1 -fi \ No newline at end of file +fi