Mercurial > octave
annotate scripts/mk-doc.pl @ 27923:bd51beb6205e
update formatting of copyright notices
* Use <https://octave.org/copyright/> instead of
<https://octave.org/COPYRIGHT.html/>.
* For consistency with other comments in the Octave sources, use
C++-style comments for copyright blocks in C and C++ files.
* Use delimiters above and below copyright blocks that are appropriate
for the language used in the file.
* Eliminate extra spacing inside copyright blocks.
* lex.ll (looks_like_copyright): Also allow newlines and carriage
returns before the word "Copyright".
* scripts/mk-doc.pl (gethelp): Also skip empty comment lines.
* bp-table.cc, type.m: Adjust tests.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 08 Jan 2020 11:59:41 -0500 |
parents | 1891570abac8 |
children | 3ed6fc50d8ae |
rev | line source |
---|---|
18939
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
1 #! /usr/bin/perl |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
2 use utf8; |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
3 |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 ######################################################################## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 # |
27919
1891570abac8
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
27918
diff
changeset
|
6 # Copyright (C) 2012-2020 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
7 # |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 # See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 # distribution or <https://octave.org/copyright/>. |
14617
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
10 # |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
11 # This file is part of Octave. |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
12 # |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23709
diff
changeset
|
13 # Octave is free software: you can redistribute it and/or modify it |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22334
diff
changeset
|
14 # under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23709
diff
changeset
|
15 # the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22334
diff
changeset
|
16 # (at your option) any later version. |
14617
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
17 # |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22334
diff
changeset
|
18 # Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22334
diff
changeset
|
19 # WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22334
diff
changeset
|
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22334
diff
changeset
|
21 # GNU General Public License for more details. |
14617
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
22 # |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
23 # You should have received a copy of the GNU General Public License |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
24 # along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23709
diff
changeset
|
25 # <https://www.gnu.org/licenses/>. |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
26 # |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
27 ######################################################################## |
14617
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
28 |
18939
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
29 use strict; |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
30 use warnings; |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
31 use File::Spec; |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
32 use Cwd; |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
33 |
14617
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
34 ## Expecting arguments in this order: |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
35 ## |
21959
627f582edbe3
extract documentation from .in.m files instead of generated .m files
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
36 ## SRCDIR SRCDIR-FILES ... |
14617
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
37 |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
38 unless (@ARGV >= 2) { die "Usage: $0 srcdir m_filename1 ..." ; } |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
39 |
18939
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
40 my $srcdir = shift (@ARGV); |
14617
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
41 |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
42 print <<__END_OF_MSG__; |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
43 ### DO NOT EDIT! |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
44 ### |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
45 ### This file is generated automatically from Octave source files. |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
46 ### Edit source files directly and run make to update this file. |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
47 |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
48 __END_OF_MSG__ |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
49 |
18943
714ce8ca71ea
mkdoc.pl: Tweaks to make code easier to understand for non-Perl experts.
Rik <rik@octave.org>
parents:
18940
diff
changeset
|
50 MFILE: foreach my $m_fname (@ARGV) |
14617
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
51 { |
18939
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
52 my $full_fname = File::Spec->catfile ($srcdir, $m_fname); |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
53 my @paths = File::Spec->splitdir ($full_fname); |
18943
714ce8ca71ea
mkdoc.pl: Tweaks to make code easier to understand for non-Perl experts.
Rik <rik@octave.org>
parents:
18940
diff
changeset
|
54 if (@paths < 3 |
714ce8ca71ea
mkdoc.pl: Tweaks to make code easier to understand for non-Perl experts.
Rik <rik@octave.org>
parents:
18940
diff
changeset
|
55 || $paths[-2] eq "private" # skip private directories |
21959
627f582edbe3
extract documentation from .in.m files instead of generated .m files
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
56 || $paths[-1] !~ s/(\.in|)\.m$//i) # skip non m-files, and remove extension |
18943
714ce8ca71ea
mkdoc.pl: Tweaks to make code easier to understand for non-Perl experts.
Rik <rik@octave.org>
parents:
18940
diff
changeset
|
57 { next MFILE; } |
14617
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
58 |
23393
675ad11b5c05
recognize docstrings for +package functions
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
59 my $fcn; |
675ad11b5c05
recognize docstrings for +package functions
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
60 if ($paths[-2] =~ m/^@/) |
675ad11b5c05
recognize docstrings for +package functions
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
61 { |
675ad11b5c05
recognize docstrings for +package functions
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
62 ## @classes will have @class/method as their function name |
675ad11b5c05
recognize docstrings for +package functions
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
63 $fcn = File::Spec->catfile (@paths[-2, -1]); |
675ad11b5c05
recognize docstrings for +package functions
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
64 } |
675ad11b5c05
recognize docstrings for +package functions
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
65 elsif ($paths[-2] =~ m/^\+/) |
675ad11b5c05
recognize docstrings for +package functions
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
66 { |
26215
39e84bf92d18
accept functions in nested +pkg directories in @DOCSTRING macros (bug #52596)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
67 $fcn = $paths[-1]; |
39e84bf92d18
accept functions in nested +pkg directories in @DOCSTRING macros (bug #52596)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
68 for (my $i = 2; $i < @paths; $i++) |
39e84bf92d18
accept functions in nested +pkg directories in @DOCSTRING macros (bug #52596)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
69 { |
39e84bf92d18
accept functions in nested +pkg directories in @DOCSTRING macros (bug #52596)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
70 if ($paths[-$i] =~ m/^\+/) |
39e84bf92d18
accept functions in nested +pkg directories in @DOCSTRING macros (bug #52596)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
71 { |
39e84bf92d18
accept functions in nested +pkg directories in @DOCSTRING macros (bug #52596)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
72 ## +package functions have package.name their function name |
39e84bf92d18
accept functions in nested +pkg directories in @DOCSTRING macros (bug #52596)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
73 $fcn = substr ($paths[-$i], 1) . "." . $fcn; |
39e84bf92d18
accept functions in nested +pkg directories in @DOCSTRING macros (bug #52596)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
74 } |
39e84bf92d18
accept functions in nested +pkg directories in @DOCSTRING macros (bug #52596)
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
75 } |
23393
675ad11b5c05
recognize docstrings for +package functions
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
76 } |
675ad11b5c05
recognize docstrings for +package functions
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
77 else |
675ad11b5c05
recognize docstrings for +package functions
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
78 { |
675ad11b5c05
recognize docstrings for +package functions
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
79 $fcn = $paths[-1]; |
675ad11b5c05
recognize docstrings for +package functions
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
80 } |
18939
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
81 |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
82 my @help_txt = gethelp ($fcn, $full_fname); |
18943
714ce8ca71ea
mkdoc.pl: Tweaks to make code easier to understand for non-Perl experts.
Rik <rik@octave.org>
parents:
18940
diff
changeset
|
83 next MFILE unless @help_txt; |
14617
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
84 |
17256
ee1d19174316
doc: Use 0x1d as record separator for joint compatibility with Texinfo 4.x and 5.x.
Rik <rik@octave.org>
parents:
17242
diff
changeset
|
85 print "\x{1d}$fcn\n"; |
22334
fed9aa2ed01d
doc: Insert correct location of m-file into @c comment in .texi files.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
86 print "\@c $fcn $m_fname\n"; |
14617
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
87 |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
88 foreach $_ (@help_txt) |
18939
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
89 { |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
90 my $in_example = (m/\s*\@example\b/ .. m/\s*\@end\s+example\b/); |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
91 s/^\s+\@/\@/ unless $in_example; |
18940
29fc1736a6be
scripts/mkdoc.pl: remove '@(end )?example' leading spaces from DOCSTRING.
Carnë Draug <carandraug@octave.org>
parents:
18939
diff
changeset
|
92 s/^\s+(\@(?:end)\s+(group|example))/$1/; |
18939
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
93 print $_; |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
94 } |
14617
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
95 } |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
96 |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
97 ################################################################################ |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
98 # Subroutines |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
99 ################################################################################ |
14644
f49e47ab83ca
maint: Rename mygethelp function to gethelp in scripts/mkdoc.pl
Rik <octave@nomad.inbox5.com>
parents:
14617
diff
changeset
|
100 sub gethelp |
14617
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
101 { |
18939
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
102 my $fcn = shift; |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
103 my $fname = shift; |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
104 open (my $fh, "<", $fname) or return; |
14617
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
105 |
18939
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
106 my @help_txt; |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
107 while (my $line = <$fh>) |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
108 { |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
109 next if $line =~ m/^[\s#%]*$/; # skip empty lines |
18939
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
110 last if $line !~ m/^\s*(#|%)/; # out of here once code starts |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
111 |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
112 my $reading_block = sub {defined ($line = <$fh>) && $line !~ m/^\s*$/}; |
14617
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
113 |
18939
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
114 ## Skip this block |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
115 if ($line =~ /(Copyright|Author)/) |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
116 { while (&$reading_block ()) {} } |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
117 else |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
118 { |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
119 do |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
120 { |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
121 $line =~ s/^\s*(%|#)+ ?//; |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
122 push (@help_txt, $line); |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
123 } while (&$reading_block ()); |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
124 last; |
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
125 } |
14617
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
126 } |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
127 |
18939
b0960d4afe5f
scripts/mkdoc.pl: improve perl code portability.
Carnë Draug <carandraug@octave.org>
parents:
18938
diff
changeset
|
128 close ($fh); |
14617
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
129 return @help_txt; |
8ffb01c3a27a
doc: Use Perl to create DOCSTRINGS in scripts directory.
Rik <octave@nomad.inbox5.com>
parents:
diff
changeset
|
130 } |