Mercurial > octave-nkf
annotate doc/interpreter/mk_doc_cache.m @ 20628:3af34e1ef330
Preliminary inclusion of uixx objects properties in the manual (bug #46076)
* doc/interpreter/genpropdoc.m: add uixx objects to the list of supported graphics objects
* doc/interpreter/genpropdoc.m (get_doc): add uixx objects and their specific properties (currently empty documentation)
* doc/interpreter/plot.txi("Interacting with Plots"): add a note and a reference about ui* family of functions.
* doc/interpreter/plot.txi("Interacting with Plots"): for consistency, remove "uimenu" reference. All the other uixx are already in the gui section
* doc/interpreter/plot.txi("graphics data structure"): add uixx objects
* doc/interpreter/gui.txi("UI Elements"): add "uimenu" function reference
* doc/module.mk: add rules to build uixx properties texi files.
* graphics.in.h: make uixx "__object__" property (Octave internal) hidden so that it does not appear in the documentation.
author | Pantxo Diribarne <pantxo.diribarne@gmail.com> |
---|---|
date | Fri, 09 Oct 2015 16:25:27 +0200 |
parents | 4197fc428c7d |
children |
rev | line source |
---|---|
19731
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19147
diff
changeset
|
1 ## Copyright (C) 2009-2015 John W. Eaton |
8716
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 ## |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
3 ## This program is free software; you can redistribute it and/or modify it |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
4 ## under the terms of the GNU General Public License as published by |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
5 ## the Free Software Foundation; either version 3 of the License, or (at |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
6 ## your option) any later version. |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
7 ## |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
8 ## This program is distributed in the hope that it will be useful, but |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
9 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
10 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
11 ## General Public License for more details. |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
12 ## |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
13 ## You should have received a copy of the GNU General Public License |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
14 ## along with this program; see the file COPYING. If not, see |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
15 ## <http://www.gnu.org/licenses/>. |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
16 |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
17 args = argv (); |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
18 |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
19 if (nargin < 2) |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
20 error ("usage: mk_doc_cache OUTPUT-FILE DOCSTRINGS-FILE ..."); |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
21 endif |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
22 |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
23 output_file = args{1}; |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
24 docstrings_files = args(2:end); |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 |
10802
c7475803e0c0
mk_doc_cache.m: Use regexp rather than fussing with character arrays
Rik <octave@nomad.inbox5.com>
parents:
10791
diff
changeset
|
26 ## Special character used as break between DOCSTRINGS |
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
|
27 doc_delim = char (0x1d); |
8716
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
28 |
10802
c7475803e0c0
mk_doc_cache.m: Use regexp rather than fussing with character arrays
Rik <octave@nomad.inbox5.com>
parents:
10791
diff
changeset
|
29 ## Read the contents of all the DOCSTRINGS files into TEXT. |
c7475803e0c0
mk_doc_cache.m: Use regexp rather than fussing with character arrays
Rik <octave@nomad.inbox5.com>
parents:
10791
diff
changeset
|
30 ## It is more efficient to fork to shell for makeinfo only once on large data |
8716
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
32 nfiles = numel (docstrings_files); |
13774
f5535b401c83
mk_doc_cache.m: Miscellaneous code cleanup for better performance.
Rik <octave@nomad.inbox5.com>
parents:
12174
diff
changeset
|
33 text = cell (1, nfiles); |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
34 for i = 1:nfiles |
8716
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
35 file = docstrings_files{i}; |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
36 fid = fopen (file, "r"); |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
37 if (fid < 0) |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
38 error ("unable to open %s for reading", file); |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
39 else |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
40 tmp = fread (fid, Inf, "*char")'; |
14614
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
41 if (isempty (strfind (tmp, doc_delim))) |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
42 ## No delimiter, copy verbatim (this is the case for the file |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
43 ## containing macro definitions, for example). |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
44 text{i} = tmp; |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
45 else |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
46 ## Strip off header lines |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
47 [~, text{i}] = strtok (tmp, doc_delim); |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14138
diff
changeset
|
48 endif |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
49 endif |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
50 endfor |
17406
3611ebb0ad88
doc: Add operator and keyword docstrings missing from lookfor cache.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
51 text = [text{:}]; |
3611ebb0ad88
doc: Add operator and keyword docstrings missing from lookfor cache.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
52 |
3611ebb0ad88
doc: Add operator and keyword docstrings missing from lookfor cache.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
53 ## Strip Texinfo marker |
3611ebb0ad88
doc: Add operator and keyword docstrings missing from lookfor cache.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
54 text = regexprep (text, "-\\*- texinfo -\\*-[ \t]*[\r\n]*", ""); |
8716
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
55 |
17406
3611ebb0ad88
doc: Add operator and keyword docstrings missing from lookfor cache.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
56 ## Add keywords and operators |
3611ebb0ad88
doc: Add operator and keyword docstrings missing from lookfor cache.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
57 other_docstrings = [__keywords__; __operators__]; |
3611ebb0ad88
doc: Add operator and keyword docstrings missing from lookfor cache.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
58 for i = 1 : numel (other_docstrings) |
3611ebb0ad88
doc: Add operator and keyword docstrings missing from lookfor cache.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
59 name = other_docstrings{i}; |
3611ebb0ad88
doc: Add operator and keyword docstrings missing from lookfor cache.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
60 ## Special handling of block comment operators such as '#{' |
3611ebb0ad88
doc: Add operator and keyword docstrings missing from lookfor cache.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
61 esc_name = regexprep (name, '([{}])', '@$1'); |
3611ebb0ad88
doc: Add operator and keyword docstrings missing from lookfor cache.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
62 text = [text doc_delim esc_name get_help_text(name) "\n"]; |
3611ebb0ad88
doc: Add operator and keyword docstrings missing from lookfor cache.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
63 endfor |
3611ebb0ad88
doc: Add operator and keyword docstrings missing from lookfor cache.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
64 text(end+1) = doc_delim; |
3611ebb0ad88
doc: Add operator and keyword docstrings missing from lookfor cache.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
65 |
3611ebb0ad88
doc: Add operator and keyword docstrings missing from lookfor cache.
Rik <rik@octave.org>
parents:
17256
diff
changeset
|
66 ## Double '@' symbol for Texinfo |
17242
3f4091dddc13
doc: Update doc cache delimiter to work with Texinfo 5.0 (bug #39778)
Mike Miller <mtmiller@ieee.org>
parents:
15834
diff
changeset
|
67 text = strrep (text, [doc_delim "@"], [doc_delim "@@"]); |
8716
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
68 |
10802
c7475803e0c0
mk_doc_cache.m: Use regexp rather than fussing with character arrays
Rik <octave@nomad.inbox5.com>
parents:
10791
diff
changeset
|
69 ## Write data to temporary file for input to makeinfo |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
70 [fid, name, msg] = mkstemp ("octave_doc_XXXXXX", true); |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
71 if (fid < 0) |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
72 error ("%s: %s\n", name, msg); |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
73 endif |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
74 fwrite (fid, text, "char"); |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
75 fclose (fid); |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
76 |
13774
f5535b401c83
mk_doc_cache.m: Miscellaneous code cleanup for better performance.
Rik <octave@nomad.inbox5.com>
parents:
12174
diff
changeset
|
77 cmd = [makeinfo_program() " --no-headers --no-warn --force --no-validate --fill-column=1024 " name]; |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
78 |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
79 [status, formatted_text] = system (cmd); |
8716
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
80 |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
81 ## Did we get the help text? |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
82 if (status != 0) |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
83 error ("makeinfo failed with exit status %d!", status); |
13774
f5535b401c83
mk_doc_cache.m: Miscellaneous code cleanup for better performance.
Rik <octave@nomad.inbox5.com>
parents:
12174
diff
changeset
|
84 elseif (isempty (formatted_text)) |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
85 error ("makeinfo produced no output!"); |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
86 endif |
8716
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
87 |
10802
c7475803e0c0
mk_doc_cache.m: Use regexp rather than fussing with character arrays
Rik <octave@nomad.inbox5.com>
parents:
10791
diff
changeset
|
88 ## Break apart output and store in cache variable |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
89 delim_idx = find (formatted_text == doc_delim); |
10802
c7475803e0c0
mk_doc_cache.m: Use regexp rather than fussing with character arrays
Rik <octave@nomad.inbox5.com>
parents:
10791
diff
changeset
|
90 n = length (delim_idx); |
8716
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
91 |
10802
c7475803e0c0
mk_doc_cache.m: Use regexp rather than fussing with character arrays
Rik <octave@nomad.inbox5.com>
parents:
10791
diff
changeset
|
92 cache = cell (3, n); # pre-allocate storage for efficiency |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
93 k = 1; |
8716
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
94 |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
95 for i = 2:n |
8716
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
96 |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
97 block = formatted_text(delim_idx(i-1)+1:delim_idx(i)-1); |
8716
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
98 |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
99 [symbol, doc] = strtok (block, "\r\n"); |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
100 |
12174 | 101 ## Skip internal functions that start with __ as these aren't |
10802
c7475803e0c0
mk_doc_cache.m: Use regexp rather than fussing with character arrays
Rik <octave@nomad.inbox5.com>
parents:
10791
diff
changeset
|
102 ## indexed by lookfor. |
11032
c9b0a75b02e8
Make all regexp in Octave compatible with both POSIX and PCRE.
Rik <octave@nomad.inbox5.com>
parents:
11020
diff
changeset
|
103 if (length (symbol) > 2 && regexp (symbol, '^__.+__$')) |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
104 continue; |
8716
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
105 endif |
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
106 |
13774
f5535b401c83
mk_doc_cache.m: Miscellaneous code cleanup for better performance.
Rik <octave@nomad.inbox5.com>
parents:
12174
diff
changeset
|
107 doc = regexprep (doc, "^[\r\n]+", '', 'once'); |
f5535b401c83
mk_doc_cache.m: Miscellaneous code cleanup for better performance.
Rik <octave@nomad.inbox5.com>
parents:
12174
diff
changeset
|
108 |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
109 if (isempty (doc)) |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
110 continue; |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
111 endif |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
112 |
13774
f5535b401c83
mk_doc_cache.m: Miscellaneous code cleanup for better performance.
Rik <octave@nomad.inbox5.com>
parents:
12174
diff
changeset
|
113 tmp = regexprep (doc, "^ -- .*$[\r\n]", '', 'lineanchors', 'dotexceptnewline'); |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
114 |
13774
f5535b401c83
mk_doc_cache.m: Miscellaneous code cleanup for better performance.
Rik <octave@nomad.inbox5.com>
parents:
12174
diff
changeset
|
115 if (isempty (tmp)) |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
116 continue; |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
117 endif |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
118 |
11032
c9b0a75b02e8
Make all regexp in Octave compatible with both POSIX and PCRE.
Rik <octave@nomad.inbox5.com>
parents:
11020
diff
changeset
|
119 end_of_first_sentence = regexp (tmp, "(\\.|[\r\n][\r\n])", "once"); |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
120 if (isempty (end_of_first_sentence)) |
10802
c7475803e0c0
mk_doc_cache.m: Use regexp rather than fussing with character arrays
Rik <octave@nomad.inbox5.com>
parents:
10791
diff
changeset
|
121 end_of_first_sentence = length (tmp); |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
122 endif |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
123 |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
124 first_sentence = tmp(1:end_of_first_sentence); |
11032
c9b0a75b02e8
Make all regexp in Octave compatible with both POSIX and PCRE.
Rik <octave@nomad.inbox5.com>
parents:
11020
diff
changeset
|
125 first_sentence = regexprep (first_sentence, "([\r\n]| {2,})", " "); |
13774
f5535b401c83
mk_doc_cache.m: Miscellaneous code cleanup for better performance.
Rik <octave@nomad.inbox5.com>
parents:
12174
diff
changeset
|
126 first_sentence = regexprep (first_sentence, '^ +', "", 'once'); |
8716
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
127 |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
128 cache{1,k} = symbol; |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
129 cache{2,k} = doc; |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
130 cache{3,k} = first_sentence; |
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
131 k++; |
8716
80910b37d855
generate DOC file for lookfor function
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
132 endfor |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
133 |
10802
c7475803e0c0
mk_doc_cache.m: Use regexp rather than fussing with character arrays
Rik <octave@nomad.inbox5.com>
parents:
10791
diff
changeset
|
134 cache(:,k:end) = []; # delete unused pre-allocated entries |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
135 |
19147
72e32208ff77
Don't save build timestamp in doc-cache header comment (bug #43087)
Mike Miller <mtmiller@ieee.org>
parents:
17744
diff
changeset
|
136 save_header_format_string (["# doc-cache created by Octave " OCTAVE_VERSION]); |
8717
28b8bd2f6e66
doc/interpreter/mk_doc_cache.m: improve performance
John W. Eaton <jwe@octave.org>
parents:
8716
diff
changeset
|
137 save ("-text", output_file, "cache"); |