/usr/share/doc/octave/octave.html/Publish-Octave-Script-Files.html is in octave-doc 4.2.2-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Publish Octave Script Files (GNU Octave)</title>
<meta name="description" content="Publish Octave Script Files (GNU Octave)">
<meta name="keywords" content="Publish Octave Script Files (GNU Octave)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Script-Files.html#Script-Files" rel="up" title="Script Files">
<link href="Publishing-Markup.html#Publishing-Markup" rel="next" title="Publishing Markup">
<link href="Script-Files.html#Script-Files" rel="prev" title="Script Files">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">
</head>
<body lang="en">
<a name="Publish-Octave-Script-Files"></a>
<div class="header">
<p>
Next: <a href="Publishing-Markup.html#Publishing-Markup" accesskey="n" rel="next">Publishing Markup</a>, Up: <a href="Script-Files.html#Script-Files" accesskey="u" rel="up">Script Files</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Publish-Octave-Script-Files-1"></a>
<h4 class="subsection">11.10.1 Publish Octave Script Files</h4>
<p>The function <code>publish</code> provides a dynamic possibility to document your
script file. Unlike static documentation, <code>publish</code> runs the script
file, saves any figures and output while running the script, and presents them
alongside static documentation in a desired output format. The static
documentation can make use of <a href="Publishing-Markup.html#Publishing-Markup">Publishing Markup</a> to enhance and
customize the output.
</p>
<a name="XREFpublish"></a><dl>
<dt><a name="index-publish"></a>: <em></em> <strong>publish</strong> <em>(<var>filename</var>)</em></dt>
<dt><a name="index-publish-1"></a>: <em></em> <strong>publish</strong> <em>(<var>filename</var>, <var>output_format</var>)</em></dt>
<dt><a name="index-publish-2"></a>: <em></em> <strong>publish</strong> <em>(<var>filename</var>, <var>option1</var>, <var>value1</var>, …)</em></dt>
<dt><a name="index-publish-3"></a>: <em></em> <strong>publish</strong> <em>(<var>filename</var>, <var>options</var>)</em></dt>
<dt><a name="index-publish-4"></a>: <em><var>output_file</var> =</em> <strong>publish</strong> <em>(<var>filename</var>, …)</em></dt>
<dd>
<p>Generate reports from Octave script files in several output formats.
</p>
<p>The generated reports consider Publishing Markup in comments,
which is explained in detail in the GNU Octave manual. Assume the
following example, using some Publishing Markup, to be the content
of a script file named ‘<samp>example.m</samp>’:
</p>
<div class="example">
<pre class="example">%% Headline title
%
% Some *bold*, _italic_, or |monospaced| Text with
% a <http://www.octave.org link to *GNU Octave*>.
%%
# "Real" Octave commands to be evaluated
sombrero ()
## Octave comment style supported as well
#
# * Bulleted list item 1
# * Bulleted list item 2
#
# # Numbered list item 1
# # Numbered list item 2
</pre></div>
<p>To publish this script file, type <code>publish ("example.m")</code>.
</p>
<p>With only <var>filename</var> given, a HTML report is generated in a
subdirectory ‘<samp>html</samp>’ relative to the current working directory.
The Octave commands are evaluated in a separate context and any
figures created while executing the script file are included in the
report. All formatting syntax of <var>filename</var> is treated according
to the specified output format and included in the report.
</p>
<p>Using <code>publish (<var>filename</var>, <var>output_format</var>)</code> is
equivalent to the function call using a structure
</p>
<div class="example">
<pre class="example"><var>options</var>.format = <var>output_format</var>;
publish (<var>filename</var>, <var>options</var>)
</pre></div>
<p>which is described below. The same holds for using option-value-pairs
</p>
<div class="example">
<pre class="example"><var>options</var>.<var>option1</var> = <var>value1</var>;
publish (<var>filename</var>, <var>options</var>)
</pre></div>
<p>The structure <var>options</var> can have the following field names. If a
field name is not specified, the default value is considered:
</p>
<ul>
<li> ‘<samp>format</samp>’ — Output format of the published script file, one of
<p>‘<samp>html</samp>’ (default), ‘<samp>doc</samp>’, ‘<samp>latex</samp>’, ‘<samp>ppt</samp>’,
‘<samp>xml</samp>’, or ‘<samp>pdf</samp>’.
</p>
<p>The output formats ‘<samp>doc</samp>’, ‘<samp>ppt</samp>’, and ‘<samp>xml</samp>’ are currently
not supported. To generate a ‘<samp>doc</samp>’ report, open a generated
‘<samp>html</samp>’ report with your office suite.
</p>
</li><li> ‘<samp>outputDir</samp>’ — Full path string of a directory, where the generated
report will be located. If no directory is given, the report is generated
in a subdirectory ‘<samp>html</samp>’ relative to the current working directory.
</li><li> ‘<samp>stylesheet</samp>’ — Not supported, only for <small>MATLAB</small> compatibility.
</li><li> ‘<samp>createThumbnail</samp>’ — Not supported, only for <small>MATLAB</small> compatibility.
</li><li> ‘<samp>figureSnapMethod</samp>’ — Not supported, only for <small>MATLAB</small> compatibility.
</li><li> ‘<samp>imageFormat</samp>’ — Desired format for images produced, while
evaluating the code. The allowed image formats depend on the output
format:
<ul>
<li> ‘<samp>html</samp>’ and ‘<samp>xml</samp>’ — ‘<samp>png</samp>’ (default), any other
image format supported by Octave
</li><li> ‘<samp>latex</samp>’ — ‘<samp>epsc2</samp>’ (default), any other image format
supported by Octave
</li><li> ‘<samp>pdf</samp>’ — ‘<samp>jpg</samp>’ (default) or ‘<samp>bmp</samp>’, note <small>MATLAB</small>
uses ‘<samp>bmp</samp>’ as default
</li><li> ‘<samp>doc</samp>’ or ‘<samp>ppt</samp>’ — ‘<samp>png</samp>’ (default), ‘<samp>jpg</samp>’,
‘<samp>bmp</samp>’, or ‘<samp>tiff</samp>’
</li></ul>
</li><li> ‘<samp>maxHeight</samp>’ and ‘<samp>maxWidth</samp>’ — Maximum height (width) of the
produced images in pixels. An empty value means no restriction. Both
values have to be set, to work properly.
<p>‘<samp>[]</samp>’ (default), integer value ≥ 0
</p>
</li><li> ‘<samp>useNewFigure</samp>’ — Use a new figure window for figures created by
the evaluated code. This avoids side effects with already opened figure
windows.
<p>‘<samp>true</samp>’ (default) or ‘<samp>false</samp>’
</p>
</li><li> ‘<samp>evalCode</samp>’ — Evaluate code of the Octave source file
<p>‘<samp>true</samp>’ (default) or ‘<samp>false</samp>’
</p>
</li><li> ‘<samp>catchError</samp>’ — Catch errors while code evaluation and continue
<p>‘<samp>true</samp>’ (default) or ‘<samp>false</samp>’
</p>
</li><li> ‘<samp>codeToEvaluate</samp>’ — Octave commands that should be evaluated prior
to publishing the script file. These Octave commands do not appear in the
generated report.
</li><li> ‘<samp>maxOutputLines</samp>’ — Maximum number of shown output lines of the
code evaluation
<p>‘<samp>Inf</samp>’ (default) or integer value > 0
</p>
</li><li> ‘<samp>showCode</samp>’ — Show the evaluated Octave commands in the generated
report
<p>‘<samp>true</samp>’ (default) or ‘<samp>false</samp>’
</p></li></ul>
<p>The returned <var>output_file</var> is a string with the path and file name
of the generated report.
</p>
<p><strong>See also:</strong> <a href="#XREFgrabcode">grabcode</a>.
</p></dd></dl>
<p>The counterpart to <code>publish</code> is <code>grabcode</code>:
</p>
<a name="XREFgrabcode"></a><dl>
<dt><a name="index-grabcode"></a>: <em></em> <strong>grabcode</strong> <em>(<var>url</var>)</em></dt>
<dt><a name="index-grabcode-1"></a>: <em><var>code_str</var> =</em> <strong>grabcode</strong> <em>(<var>url</var>)</em></dt>
<dd>
<p>Grab by the <code>publish</code> function generated HTML reports from Octave
script files.
</p>
<p>The input parameter <var>url</var> must point to a local or remote HTML file
with extension ‘<samp>.htm</samp>’ or ‘<samp>.html</samp>’ which was generated by the
<code>publish</code> function. With any other HTML file this will not work!
</p>
<p>If no return value is given, the grabbed code is saved to a temporary
file and opened in the default editor.
</p>
<p>NOTE: You have to save the file at another location with arbitrary name,
otherwise any grabbed code will be lost!
</p>
<p>With a return value given, the grabbed code will be returned as string
<var>code_str</var>.
</p>
<p>An example:
</p>
<div class="example">
<pre class="example">publish ("my_script.m");
grabcode ("html/my_script.html");
</pre></div>
<p>The example above publishes ‘<samp>my_script.m</samp>’ by default to
‘<samp>html/my_script.html</samp>’. Afterwards this published Octave script
is grabbed to edit its content in a new temporary file.
</p>
<p><strong>See also:</strong> <a href="#XREFpublish">publish</a>.
</p></dd></dl>
<hr>
<div class="header">
<p>
Next: <a href="Publishing-Markup.html#Publishing-Markup" accesskey="n" rel="next">Publishing Markup</a>, Up: <a href="Script-Files.html#Script-Files" accesskey="u" rel="up">Script Files</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|