@ -27,7 +27,7 @@ When adding `x` and `y` together we obtain a new rational number:
@@ -27,7 +27,7 @@ When adding `x` and `y` together we obtain a new rational number:
```@example name
z = x + y
```</code></pre><p>We note that lines starting with <code>#'</code> is printed as regular markdown, and the code lines have been wrapped in <code>@example</code> blocks.</p><p>Some of the output rendering can be controlled with keyword arguments to <ahref="outputformats.html#Literate.markdown"><code>Literate.markdown</code></a>:</p><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="Literate.markdown"href="#Literate.markdown"><code>Literate.markdown</code></a> — <spanclass="docstring-category">Function</span>.</div><div><pre><codeclass="language-none">Literate.markdown(inputfile, outputdir; kwargs...)</code></pre><p>Generate a markdown file from <code>inputfile</code> and write the result to the directory<code>outputdir</code>.</p><p>Keyword arguments:</p><ul><li><p><code>name</code>: name of the output file, excluding <code>.md</code>. <code>name</code> is also used to name all the <code>@example</code> blocks, and to replace <code>@__NAME__</code>. Defaults to the filename of <code>inputfile</code>.</p></li><li><p><code>preprocess</code>, <code>postprocess</code>: custom pre- and post-processing functions, see the <ahref="customprocessing.html#Custom-pre-and-post-processing-1">Custom pre- and post-processing</a> section of the manual. Defaults to <code>identity</code>.</p></li><li><p><code>documenter</code>: boolean that tells if the output is intended to use with Documenter.jl. Defaults to <code>true</code>. See the the manual section on <ahref="documenter.html#Interaction-with-Documenter-1">Interaction with Documenter</a>.</p></li><li><p><code>codefence</code>: A <code>Pair</code> of opening and closing code fence. Defaults to</p><pre><codeclass="language-none">"```@example $(name)" =>"```"</code></pre><p>if <code>documenter = true</code> and</p><pre><codeclass="language-none">"```julia" =>"```"</code></pre><p>if <code>documenter = false</code>.</p></li></ul></div><aclass="source-link"target="_blank"href="https://github.com/fredrikekre/Literate.jl/blob/b57e6cca5cc5b3dd9565d76fead4adaf32a982cd/src/Literate.jl#L270-L295">source</a></section><h2><aclass="nav-anchor"id="Notebook-Output-1"href="#Notebook-Output-1"><strong>4.2.</strong> Notebook Output</a></h2><p>The (default) notebook output of the source snippet above is as follows</p><pre><codeclass="language-none"> │ # Rational numbers
```</code></pre><p>We note that lines starting with <code>#'</code> is printed as regular markdown, and the code lines have been wrapped in <code>@example</code> blocks.</p><p>Some of the output rendering can be controlled with keyword arguments to <ahref="outputformats.html#Literate.markdown"><code>Literate.markdown</code></a>:</p><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="Literate.markdown"href="#Literate.markdown"><code>Literate.markdown</code></a> — <spanclass="docstring-category">Function</span>.</div><div><pre><codeclass="language-none">Literate.markdown(inputfile, outputdir; kwargs...)</code></pre><p>Generate a markdown file from <code>inputfile</code> and write the result to the directory<code>outputdir</code>.</p><p>Keyword arguments:</p><ul><li><p><code>name</code>: name of the output file, excluding <code>.md</code>. <code>name</code> is also used to name all the <code>@example</code> blocks, and to replace <code>@__NAME__</code>. Defaults to the filename of <code>inputfile</code>.</p></li><li><p><code>preprocess</code>, <code>postprocess</code>: custom pre- and post-processing functions, see the <ahref="customprocessing.html#Custom-pre-and-post-processing-1">Custom pre- and post-processing</a> section of the manual. Defaults to <code>identity</code>.</p></li><li><p><code>documenter</code>: boolean that tells if the output is intended to use with Documenter.jl. Defaults to <code>true</code>. See the the manual section on <ahref="documenter.html#Interaction-with-Documenter-1">Interaction with Documenter</a>.</p></li><li><p><code>codefence</code>: A <code>Pair</code> of opening and closing code fence. Defaults to</p><pre><codeclass="language-none">"```@example $(name)" =>"```"</code></pre><p>if <code>documenter = true</code> and</p><pre><codeclass="language-none">"```julia" =>"```"</code></pre><p>if <code>documenter = false</code>.</p></li></ul></div><aclass="source-link"target="_blank"href="https://github.com/fredrikekre/Literate.jl/blob/b3e9d92aa84ec6bfa35e173293df7613c660b064/src/Literate.jl#L270-L295">source</a></section><h2><aclass="nav-anchor"id="Notebook-Output-1"href="#Notebook-Output-1"><strong>4.2.</strong> Notebook Output</a></h2><p>The (default) notebook output of the source snippet above is as follows</p><pre><codeclass="language-none"> │ # Rational numbers
│
│ In julia rational numbers can be constructed with the `//` operator.
│ When adding `x` and `y` together we obtain a new rational number:
In[3]: │ z = x + y
Out[3]: │ 11/15</code></pre><p>We note that lines starting with <code>#'</code> is put in markdown cells, and the code lines have been put in code cells. By default the notebook is also executed and output cells populated. The current working directory is set to the specified output directory the notebook is executed. Some of the output rendering can be controlled with keyword arguments to <ahref="outputformats.html#Literate.notebook"><code>Literate.notebook</code></a>:</p><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="Literate.notebook"href="#Literate.notebook"><code>Literate.notebook</code></a> — <spanclass="docstring-category">Function</span>.</div><div><pre><codeclass="language-none">Literate.notebook(inputfile, outputdir; kwargs...)</code></pre><p>Generate a notebook from <code>inputfile</code> and write the result to <code>outputdir</code>.</p><p>Keyword arguments:</p><ul><li><p><code>name</code>: name of the output file, excluding <code>.ipynb</code>. <code>name</code> is also used to replace <code>@__NAME__</code>. Defaults to the filename of <code>inputfile</code>.</p></li><li><p><code>preprocess</code>, <code>postprocess</code>: custom pre- and post-processing functions, see the <ahref="customprocessing.html#Custom-pre-and-post-processing-1">Custom pre- and post-processing</a> section of the manual. Defaults to <code>identity</code>.</p></li><li><p><code>execute</code>: a boolean deciding if the generated notebook should also be executed or not. Defaults to <code>true</code>. The current working directory is set to <code>outputdir</code> when executing the notebook.</p></li><li><p><code>documenter</code>: boolean that says if the source contains Documenter.jl specific things to filter out during notebook generation. Defaults to <code>true</code>. See the the manual section on <ahref="documenter.html#Interaction-with-Documenter-1">Interaction with Documenter</a>.</p></li></ul></div><aclass="source-link"target="_blank"href="https://github.com/fredrikekre/Literate.jl/blob/b57e6cca5cc5b3dd9565d76fead4adaf32a982cd/src/Literate.jl#L366-L383">source</a></section><h2><aclass="nav-anchor"id="Script-Output-1"href="#Script-Output-1"><strong>4.3.</strong> Script Output</a></h2><p>The (default) script output of the source snippet above is as follows</p><pre><codeclass="language-julia">x = 1//3
Out[3]: │ 11/15</code></pre><p>We note that lines starting with <code>#'</code> is put in markdown cells, and the code lines have been put in code cells. By default the notebook is also executed and output cells populated. The current working directory is set to the specified output directory the notebook is executed. Some of the output rendering can be controlled with keyword arguments to <ahref="outputformats.html#Literate.notebook"><code>Literate.notebook</code></a>:</p><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="Literate.notebook"href="#Literate.notebook"><code>Literate.notebook</code></a> — <spanclass="docstring-category">Function</span>.</div><div><pre><codeclass="language-none">Literate.notebook(inputfile, outputdir; kwargs...)</code></pre><p>Generate a notebook from <code>inputfile</code> and write the result to <code>outputdir</code>.</p><p>Keyword arguments:</p><ul><li><p><code>name</code>: name of the output file, excluding <code>.ipynb</code>. <code>name</code> is also used to replace <code>@__NAME__</code>. Defaults to the filename of <code>inputfile</code>.</p></li><li><p><code>preprocess</code>, <code>postprocess</code>: custom pre- and post-processing functions, see the <ahref="customprocessing.html#Custom-pre-and-post-processing-1">Custom pre- and post-processing</a> section of the manual. Defaults to <code>identity</code>.</p></li><li><p><code>execute</code>: a boolean deciding if the generated notebook should also be executed or not. Defaults to <code>true</code>. The current working directory is set to <code>outputdir</code> when executing the notebook.</p></li><li><p><code>documenter</code>: boolean that says if the source contains Documenter.jl specific things to filter out during notebook generation. Defaults to <code>true</code>. See the the manual section on <ahref="documenter.html#Interaction-with-Documenter-1">Interaction with Documenter</a>.</p></li></ul></div><aclass="source-link"target="_blank"href="https://github.com/fredrikekre/Literate.jl/blob/b3e9d92aa84ec6bfa35e173293df7613c660b064/src/Literate.jl#L366-L383">source</a></section><h2><aclass="nav-anchor"id="Script-Output-1"href="#Script-Output-1"><strong>4.3.</strong> Script Output</a></h2><p>The (default) script output of the source snippet above is as follows</p><pre><codeclass="language-julia">x = 1//3
y = 2//5
z = x + y</code></pre><p>We note that lines starting with <code>#'</code> are removed and only the code lines have been kept. Some of the output rendering can be controlled with keyword arguments to <ahref="outputformats.html#Literate.script"><code>Literate.script</code></a>:</p><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="Literate.script"href="#Literate.script"><code>Literate.script</code></a> — <spanclass="docstring-category">Function</span>.</div><div><pre><codeclass="language-none">Literate.script(inputfile, outputdir; kwargs...)</code></pre><p>Generate a plain script file from <code>inputfile</code> and write the result to <code>outputdir</code>.</p><p>Keyword arguments:</p><ul><li><p><code>name</code>: name of the output file, excluding <code>.jl</code>. <code>name</code> is also used to replace <code>@__NAME__</code>. Defaults to the filename of <code>inputfile</code>.</p></li><li><p><code>preprocess</code>, <code>postprocess</code>: custom pre- and post-processing functions, see the <ahref="customprocessing.html#Custom-pre-and-post-processing-1">Custom pre- and post-processing</a> section of the manual. Defaults to <code>identity</code>.</p></li><li><p><code>documenter</code>: boolean that says if the source contains Documenter.jl specific things to filter out during script generation. Defaults to <code>true</code>. See the the manual section on <ahref="documenter.html#Interaction-with-Documenter-1">Interaction with Documenter</a>.</p></li><li><p><code>keep_comments</code>: boolean that, if set to <code>true</code>, keeps markdown lines (<code>#'</code>) as comments in the output script. Defaults to <code>false</code>.</p></li></ul></div><aclass="source-link"target="_blank"href="https://github.com/fredrikekre/Literate.jl/blob/b57e6cca5cc5b3dd9565d76fead4adaf32a982cd/src/Literate.jl#L206-L222">source</a></section><footer><hr/><aclass="previous"href="pipeline.html"><spanclass="direction">Previous</span><spanclass="title"><strong>3.</strong> Processing pipeline</span></a><aclass="next"href="customprocessing.html"><spanclass="direction">Next</span><spanclass="title"><strong>5.</strong> Custom pre- and post-processing</span></a></footer></article></body></html>
z = x + y</code></pre><p>We note that lines starting with <code>#'</code> are removed and only the code lines have been kept. Some of the output rendering can be controlled with keyword arguments to <ahref="outputformats.html#Literate.script"><code>Literate.script</code></a>:</p><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="Literate.script"href="#Literate.script"><code>Literate.script</code></a> — <spanclass="docstring-category">Function</span>.</div><div><pre><codeclass="language-none">Literate.script(inputfile, outputdir; kwargs...)</code></pre><p>Generate a plain script file from <code>inputfile</code> and write the result to <code>outputdir</code>.</p><p>Keyword arguments:</p><ul><li><p><code>name</code>: name of the output file, excluding <code>.jl</code>. <code>name</code> is also used to replace <code>@__NAME__</code>. Defaults to the filename of <code>inputfile</code>.</p></li><li><p><code>preprocess</code>, <code>postprocess</code>: custom pre- and post-processing functions, see the <ahref="customprocessing.html#Custom-pre-and-post-processing-1">Custom pre- and post-processing</a> section of the manual. Defaults to <code>identity</code>.</p></li><li><p><code>documenter</code>: boolean that says if the source contains Documenter.jl specific things to filter out during script generation. Defaults to <code>true</code>. See the the manual section on <ahref="documenter.html#Interaction-with-Documenter-1">Interaction with Documenter</a>.</p></li><li><p><code>keep_comments</code>: boolean that, if set to <code>true</code>, keeps markdown lines (<code>#'</code>) as comments in the output script. Defaults to <code>false</code>.</p></li></ul></div><aclass="source-link"target="_blank"href="https://github.com/fredrikekre/Literate.jl/blob/b3e9d92aa84ec6bfa35e173293df7613c660b064/src/Literate.jl#L206-L222">source</a></section><footer><hr/><aclass="previous"href="pipeline.html"><spanclass="direction">Previous</span><spanclass="title"><strong>3.</strong> Processing pipeline</span></a><aclass="next"href="customprocessing.html"><spanclass="direction">Next</span><spanclass="title"><strong>5.</strong> Custom pre- and post-processing</span></a></footer></article></body></html>