annotate scripts/help/__makeinfo__.m @ 13141:e81ddf9cacd5

maint: untabify and remove trailing whitespace from source files * bicg.m, gmres.m, pkg.m: Untabify and remove trailing whitespace. * libcruft/Makefile.am, libcruft/blas-xtra/cdotc3.f, libcruft/blas-xtra/cmatm3.f, libcruft/blas-xtra/ddot3.f, libcruft/blas-xtra/dmatm3.f, libcruft/blas-xtra/sdot3.f, libcruft/blas-xtra/smatm3.f, libcruft/blas-xtra/zdotc3.f, libcruft/blas-xtra/zmatm3.f, libcruft/lapack-xtra/crsf2csf.f, libcruft/lapack-xtra/zrsf2csf.f, liboctave/Array.cc, liboctave/DASPK-opts.in, liboctave/DASRT-opts.in, liboctave/DASSL-opts.in, liboctave/LSODE-opts.in, liboctave/Makefile.a,mliboctave/Quad-opts.in, liboctave/Sparse-perm-op-defs.h, scripts/Makefile.a,mscripts/deprecated/glpkmex.m, scripts/general/blkdiag.m, scripts/general/interp1.m, scripts/general/profshow.m, scripts/general/quadl.m, scripts/general/triplequad.m, scripts/help/__makeinfo__.m, scripts/io/strread.m, scripts/io/textread.m, scripts/io/textscan.m, scripts/linear-algebra/rank.m, scripts/miscellaneous/gzip.m, scripts/miscellaneous/private/__xzip__.m, scripts/miscellaneous/tempdir.m, scripts/miscellaneous/unpack.m, scripts/pkg/pkg.m, scripts/plot/allchild.m, scripts/plot/ancestor.m, scripts/plot/cla.m, scripts/plot/clf.m, scripts/plot/findall.m, scripts/plot/findobj.m, scripts/plot/gca.m, scripts/plot/gcf.m, scripts/plot/hggroup.m, scripts/plot/isfigure.m, scripts/plot/ishghandle.m, scripts/plot/legend.m, scripts/plot/line.m, scripts/plot/loglog.m, scripts/plot/patch.m, scripts/plot/print.m, scripts/plot/private/__quiver__.m, scripts/plot/private/__scatter__.m, scripts/plot/rectangle.m, scripts/plot/semilogx.m, scripts/plot/semilogy.m, scripts/plot/surface.m, scripts/plot/text.m, scripts/plot/title.m, scripts/plot/trisurf.m, scripts/plot/view.m, scripts/plot/whitebg.m, scripts/plot/xlabel.m, scripts/plot/xlim.m, scripts/plot/ylabel.m, scripts/plot/ylim.m, scripts/plot/zlabel.m, scripts/plot/zlim.m, scripts/polynomial/mkpp.m, scripts/polynomial/polygcd.m, scripts/polynomial/ppint.m, scripts/polynomial/ppjumps.m, scripts/polynomial/ppval.m, scripts/set/setxor.m, scripts/sparse/bicgstab.m, scripts/sparse/cgs.m, scripts/sparse/spconvert.m, scripts/specfun/nthroot.m, scripts/strings/strmatch.m, scripts/strings/untabify.m, scripts/testfun/demo.m, scripts/testfun/example.m, src/DLD-FUNCTIONS/filter.cc, src/DLD-FUNCTIONS/mgorth.cc, src/DLD-FUNCTIONS/quadcc.cc, src/DLD-FUNCTIONS/str2double.cc, src/Makefile.a,msrc/gl-render.cc, src/gl2ps-renderer.cc, src/graphics.cc, src/octave-config.cc.in, src/octave-config.in, src/ov-class.h, src/ov-fcn.h, src/profiler.cc, src/profiler.h, src/pt-binop.cc, src/pt-unop.cc, src/symtab.cc, src/txt-eng-ft.cc: Remove trailing whitespace.
author John W. Eaton <jwe@octave.org>
date Thu, 15 Sep 2011 12:51:10 -0400
parents f80273b38cc4
children 8c7caa009a1e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11523
fd0a3ac60b0e update copyright notices
John W. Eaton <jwe@octave.org>
parents: 11104
diff changeset
1 ## Copyright (C) 2009-2011 S�ren Hauberg
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
2 ##
11104
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10803
diff changeset
3 ## This file is part of Octave.
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10803
diff changeset
4 ##
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10803
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
8 ## your option) any later version.
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
9 ##
11104
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10803
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
13 ## General Public License for more details.
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
14 ##
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
11104
2c356a35d7f5 fix copyright notices
John W. Eaton <jwe@octave.org>
parents: 10803
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
18
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
19 ## -*- texinfo -*-
13121
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
20 ## @deftypefn {Function File} {[@var{retval}, @var{status}] =} __makeinfo__ (@var{text}, @var{output_type})
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
21 ## @deftypefnx {Function File} {[@var{retval}, @var{status}] =} __makeinfo__ (@var{text}, @var{output_type}, @var{see_also})
8768
e0fbf17a17bb __makeinfo__.m: rename from makeinfo.m
John W. Eaton <jwe@octave.org>
parents: 8717
diff changeset
22 ## Undocumented internal function.
e0fbf17a17bb __makeinfo__.m: rename from makeinfo.m
John W. Eaton <jwe@octave.org>
parents: 8717
diff changeset
23 ## @end deftypefn
e0fbf17a17bb __makeinfo__.m: rename from makeinfo.m
John W. Eaton <jwe@octave.org>
parents: 8717
diff changeset
24
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
25 ## Run @code{makeinfo} on a given text.
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
26 ##
8768
e0fbf17a17bb __makeinfo__.m: rename from makeinfo.m
John W. Eaton <jwe@octave.org>
parents: 8717
diff changeset
27 ## The string @var{text} is run through the @code{__makeinfo__} program
e0fbf17a17bb __makeinfo__.m: rename from makeinfo.m
John W. Eaton <jwe@octave.org>
parents: 8717
diff changeset
28 ## to generate output in various formats. This string must contain valid
e0fbf17a17bb __makeinfo__.m: rename from makeinfo.m
John W. Eaton <jwe@octave.org>
parents: 8717
diff changeset
29 ## Texinfo formatted text.
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
30 ##
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
31 ## The @var{output_type} selects the format of the output. This can be either
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
32 ## @t{"html"}, @t{"texinfo"}, or @t{"plain text"}. By default this is
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
33 ## @t{"plain text"}. If @var{output_type} is @t{"texinfo"}, the @t{@@seealso}
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
34 ## macro is expanded, but otherwise the text is unaltered.
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
35 ##
13121
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
36 ## If the optional argument @var{see_also} is present, it is used to expand the
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
37 ## Octave specific @t{@@seealso} macro. This argument must be a function handle,
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
38 ## that accepts a cell array of strings as input argument (each elements of the
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
39 ## array corresponds to the arguments to the @t{@@seealso} macro), and return
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
40 ## the expanded string. If this argument is not given, the @t{@@seealso} macro
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
41 ## will be expanded to the text
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
42 ##
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
43 ## @example
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
44 ## See also: arg1, arg2@, ...
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
45 ## @end example
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
46 ##
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
47 ## @noindent
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
48 ## for @t{"plain text"} output, and
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
49 ##
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
50 ## @example
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
51 ## See also: @@ref@{arg1@}, @@ref@{arg2@}, ...
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
52 ## @end example
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
53 ##
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
54 ## @noindent
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
55 ## otherwise.
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
56 ##
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
57 ## The optional output argument @var{status} contains the exit status of the
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
58 ## @code{makeinfo} program as returned by @code{system}.
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
59
13122
f80273b38cc4 more fixes to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13121
diff changeset
60 function [retval, status] = __makeinfo__ (text, output_type = "plain text", fsee_also)
8768
e0fbf17a17bb __makeinfo__.m: rename from makeinfo.m
John W. Eaton <jwe@octave.org>
parents: 8717
diff changeset
61
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
62 ## Check input
13121
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
63 if (nargin < 1 || nargin > 3)
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
64 print_usage ();
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
65 endif
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
66
13122
f80273b38cc4 more fixes to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13121
diff changeset
67 if (! ischar (text))
8768
e0fbf17a17bb __makeinfo__.m: rename from makeinfo.m
John W. Eaton <jwe@octave.org>
parents: 8717
diff changeset
68 error ("__makeinfo__: first input argument must be a string");
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
69 endif
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
70
13122
f80273b38cc4 more fixes to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13121
diff changeset
71 if (! ischar (output_type))
8768
e0fbf17a17bb __makeinfo__.m: rename from makeinfo.m
John W. Eaton <jwe@octave.org>
parents: 8717
diff changeset
72 error ("__makeinfo__: second input argument must be a string");
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
73 endif
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
74
13141
e81ddf9cacd5 maint: untabify and remove trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 13122
diff changeset
75 if (nargin < 3)
13121
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
76 if (strcmpi (output_type, "plain text"))
13122
f80273b38cc4 more fixes to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13121
diff changeset
77 fsee_also = @(T) strcat ...
f80273b38cc4 more fixes to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13121
diff changeset
78 ("\nSee also:", sprintf (" %s,", T{:})(1:end-1), "\n");
13141
e81ddf9cacd5 maint: untabify and remove trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 13122
diff changeset
79 else
13122
f80273b38cc4 more fixes to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13121
diff changeset
80 fsee_also = @(T) strcat ...
f80273b38cc4 more fixes to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13121
diff changeset
81 ("\nSee also:", sprintf (" @ref{%s},", T{:})(1:end-1), "\n");
13121
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
82 endif
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
83 endif
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
84
13122
f80273b38cc4 more fixes to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13121
diff changeset
85 if (! isa (fsee_also, "function_handle"))
13121
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
86 error (["__makeinfo__: third input argument must ", ...
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
87 "be the empty matrix, or a function handle"]);
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
88 endif
13141
e81ddf9cacd5 maint: untabify and remove trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 13122
diff changeset
89
13121
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
90
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
91 ## It seems like makeinfo sometimes gets angry if the first character
10803
75780a2b0417 __makeinfo__.m: Add support to process @nopsell macro.
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
92 ## on a line is a space, so we remove these.
13141
e81ddf9cacd5 maint: untabify and remove trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 13122
diff changeset
93 text = strrep (text, "\n ", "\n");
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
94
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
95 ## Handle @seealso macro
13121
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
96 see_also_pat = '@seealso *\{([^}]*)\}';
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
97 args = regexp (text, see_also_pat, 'tokens');
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
98 for ii = 1:numel (args)
13122
f80273b38cc4 more fixes to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13121
diff changeset
99 expanded = fsee_also (strtrim (strsplit (args{ii}{:}, ',', true)));
f80273b38cc4 more fixes to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13121
diff changeset
100 text = regexprep (text, see_also_pat, expanded, 'once');
13121
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
101 endfor
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
102
10803
75780a2b0417 __makeinfo__.m: Add support to process @nopsell macro.
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
103 ## Handle @nospell macro
12606
3047363c376d __makeinfo__.m: Simplify function by using regular expressions.
Rik <octave@nomad.inbox5.com>
parents: 11587
diff changeset
104 text = regexprep (text, '@nospell *\{([^}]*)\}', "$1");
10803
75780a2b0417 __makeinfo__.m: Add support to process @nopsell macro.
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
105
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
106 if (strcmpi (output_type, "texinfo"))
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
107 status = 0;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
108 retval = text;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
109 return;
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
110 endif
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
111
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
112 ## Create the final TeXinfo input string
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
113 text = sprintf ("\\input texinfo\n\n%s\n\n@bye\n", text);
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
114
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
115 unwind_protect
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
116 ## Write Texinfo to tmp file
9983
2d347a2f4a0a __makeinfo__: style fixes
John W. Eaton <jwe@octave.org>
parents: 9982
diff changeset
117 template = "octave-help-XXXXXX";
13122
f80273b38cc4 more fixes to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13121
diff changeset
118 [fid, name] = mkstemp (fullfile (P_tmpdir, template), true);
9982
7cef030b8069 let __makeinfo__ create temporary file in P_tmpdir
Jaroslav Hajek <highegg@gmail.com>
parents: 9263
diff changeset
119 if (fid < 0)
7cef030b8069 let __makeinfo__ create temporary file in P_tmpdir
Jaroslav Hajek <highegg@gmail.com>
parents: 9263
diff changeset
120 error ("__makeinfo__: could not create temporary file");
7cef030b8069 let __makeinfo__ create temporary file in P_tmpdir
Jaroslav Hajek <highegg@gmail.com>
parents: 9263
diff changeset
121 endif
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
122 fwrite (fid, text);
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
123 fclose (fid);
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
124
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
125 ## Take action depending on output type
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
126 switch (lower (output_type))
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
127 case "plain text"
13121
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
128 cmd = sprintf ("%s --no-headers --no-warn --force --no-validate %s",
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
129 makeinfo_program (), name);
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
130 case "html"
13121
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
131 cmd = sprintf ("%s --no-headers --html --no-warn --no-validate --force %s",
390add500107 Add back the third input parameter to __makeinfo__
Carlo de Falco <kingcrimson@tiscali.it>
parents: 13120
diff changeset
132 makeinfo_program (), name);
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
133 otherwise
8768
e0fbf17a17bb __makeinfo__.m: rename from makeinfo.m
John W. Eaton <jwe@octave.org>
parents: 8717
diff changeset
134 error ("__makeinfo__: unsupported output type: '%s'", output_type);
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
135 endswitch
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
136
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
137 ## Call makeinfo
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
138 [status, retval] = system (cmd);
10803
75780a2b0417 __makeinfo__.m: Add support to process @nopsell macro.
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
139
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
140 unwind_protect_cleanup
8768
e0fbf17a17bb __makeinfo__.m: rename from makeinfo.m
John W. Eaton <jwe@octave.org>
parents: 8717
diff changeset
141 if (exist (name, "file"))
e0fbf17a17bb __makeinfo__.m: rename from makeinfo.m
John W. Eaton <jwe@octave.org>
parents: 8717
diff changeset
142 delete (name);
e0fbf17a17bb __makeinfo__.m: rename from makeinfo.m
John W. Eaton <jwe@octave.org>
parents: 8717
diff changeset
143 endif
8575
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
144 end_unwind_protect
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
145 endfunction
f134925a1cfa m-file implementation of help system
Soren Hauberg <soren@hauberg.org>
parents:
diff changeset
146
13044
a04e32272ecb codesprint: Turn off test warning for various internal helper functions
Rik <octave@nomad.inbox5.com>
parents: 12606
diff changeset
147 ## No test needed for internal helper function.
a04e32272ecb codesprint: Turn off test warning for various internal helper functions
Rik <octave@nomad.inbox5.com>
parents: 12606
diff changeset
148 %!assert (1)
a04e32272ecb codesprint: Turn off test warning for various internal helper functions
Rik <octave@nomad.inbox5.com>
parents: 12606
diff changeset
149