comparison doc/interpreter/mk_doc_cache.m @ 17406:3611ebb0ad88

doc: Add operator and keyword docstrings missing from lookfor cache. * doc/interpreter/mk_doc_cache.m: Append operator and keyword docstrings to file containing function docstrings before passing through makeinfo.
author Rik <rik@octave.org>
date Tue, 10 Sep 2013 22:00:19 -0700
parents ee1d19174316
children d63878346099
comparison
equal deleted inserted replaced
17405:3f0ed69d21c6 17406:3611ebb0ad88
46 ## Strip off header lines 46 ## Strip off header lines
47 [~, text{i}] = strtok (tmp, doc_delim); 47 [~, text{i}] = strtok (tmp, doc_delim);
48 endif 48 endif
49 endif 49 endif
50 endfor 50 endfor
51 text = [text{:}, doc_delim]; 51 text = [text{:}];
52 52
53 ## Strip Texinfo markers and docstring separators. 53 ## Strip Texinfo marker
54 text = regexprep (text, "-\\*- texinfo -\\*-[ \t]*[\r\n]*", ""); 54 text = regexprep (text, "-\\*- texinfo -\\*-[ \t]*[\r\n]*", "");
55
56 ## Add keywords and operators
57 other_docstrings = [__keywords__; __operators__];
58 for i = 1 : numel (other_docstrings)
59 name = other_docstrings{i};
60 ## Special handling of block comment operators such as '#{'
61 esc_name = regexprep (name, '([{}])', '@$1');
62 text = [text doc_delim esc_name get_help_text(name) "\n"];
63 endfor
64 text(end+1) = doc_delim;
65
66 ## Double '@' symbol for Texinfo
55 text = strrep (text, [doc_delim "@"], [doc_delim "@@"]); 67 text = strrep (text, [doc_delim "@"], [doc_delim "@@"]);
56 68
57 ## Write data to temporary file for input to makeinfo 69 ## Write data to temporary file for input to makeinfo
58 [fid, name, msg] = mkstemp ("octave_doc_XXXXXX", true); 70 [fid, name, msg] = mkstemp ("octave_doc_XXXXXX", true);
59 if (fid < 0) 71 if (fid < 0)