<htmllang="en"><head><metacharset="UTF-8"/><metaname="viewport"content="width=device-width, initial-scale=1.0"/><title>6. Interaction with Documenter.jl · Examples.jl</title><linkhref="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css"rel="stylesheet"type="text/css"/><linkhref="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"rel="stylesheet"type="text/css"/><script>documenterBaseURL="."</script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js"data-main="assets/documenter.js"></script><scriptsrc="siteinfo.js"></script><scriptsrc="../versions.js"></script><linkhref="assets/documenter.css"rel="stylesheet"type="text/css"/></head><body><navclass="toc"><h1>Examples.jl</h1><selectid="version-selector"onChange="window.location.href=this.value"style="visibility: hidden"></select><formclass="search"id="search-form"action="search.html"><inputid="search-query"name="q"type="text"placeholder="Search docs"/></form><ul><li><aclass="toctext"href="index.html"><strong>1.</strong> Introduction</a></li><li><aclass="toctext"href="fileformat.html"><strong>2.</strong> File Format</a></li><li><aclass="toctext"href="pipeline.html"><strong>3.</strong> Processing pipeline</a></li><li><aclass="toctext"href="outputformats.html"><strong>4.</strong> Output formats</a></li><li><aclass="toctext"href="customprocessing.html"><strong>5.</strong> Custom pre- and post-processing</a></li><liclass="current"><aclass="toctext"href="documenter.html"><strong>6.</strong> Interaction with Documenter.jl</a><ulclass="internal"></ul></li><li><aclass="toctext"href="generated/example.html"><strong>7.</strong> Example</a></li></ul></nav><articleid="docs"><header><nav><ul><li><ahref="documenter.html"><strong>6.</strong> Interaction with Documenter.jl</a></li></ul><aclass="edit-page"href="https://github.com/fredrikekre/Examples.jl/blob/master/docs/src/documenter.md"><spanclass="fa"></span> Edit on GitHub</a></nav><hr/><divid="topbar"><span>6. Interaction with Documenter.jl</span><aclass="fa fa-bars"href="#"></a></div></header><h1><aclass="nav-anchor"id="Interaction-with-Documenter-1"href="#Interaction-with-Documenter-1"><strong>6.</strong> Interaction with Documenter.jl</a></h1><p>TBW</p><footer><hr/><aclass="previous"href="customprocessing.html"><spanclass="direction">Previous</span><spanclass="title"><strong>5.</strong> Custom pre- and post-processing</span></a><aclass="next"href="generated/example.html"><spanclass="direction">Next</span><spanclass="title"><strong>7.</strong> Example</span></a></footer></article></body></html>
<htmllang="en"><head><metacharset="UTF-8"/><metaname="viewport"content="width=device-width, initial-scale=1.0"/><title>6. Interaction with Documenter.jl · Examples.jl</title><linkhref="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css"rel="stylesheet"type="text/css"/><linkhref="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css"rel="stylesheet"type="text/css"/><linkhref="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"rel="stylesheet"type="text/css"/><script>documenterBaseURL="."</script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js"data-main="assets/documenter.js"></script><scriptsrc="siteinfo.js"></script><scriptsrc="../versions.js"></script><linkhref="assets/documenter.css"rel="stylesheet"type="text/css"/></head><body><navclass="toc"><h1>Examples.jl</h1><selectid="version-selector"onChange="window.location.href=this.value"style="visibility: hidden"></select><formclass="search"id="search-form"action="search.html"><inputid="search-query"name="q"type="text"placeholder="Search docs"/></form><ul><li><aclass="toctext"href="index.html"><strong>1.</strong> Introduction</a></li><li><aclass="toctext"href="fileformat.html"><strong>2.</strong> File Format</a></li><li><aclass="toctext"href="pipeline.html"><strong>3.</strong> Processing pipeline</a></li><li><aclass="toctext"href="outputformats.html"><strong>4.</strong> Output formats</a></li><li><aclass="toctext"href="customprocessing.html"><strong>5.</strong> Custom pre- and post-processing</a></li><liclass="current"><aclass="toctext"href="documenter.html"><strong>6.</strong> Interaction with Documenter.jl</a><ulclass="internal"></ul></li><li><aclass="toctext"href="generated/example.html"><strong>7.</strong> Example</a></li></ul></nav><articleid="docs"><header><nav><ul><li><ahref="documenter.html"><strong>6.</strong> Interaction with Documenter.jl</a></li></ul><aclass="edit-page"href="https://github.com/fredrikekre/Examples.jl/blob/master/docs/src/documenter.md"><spanclass="fa"></span> Edit on GitHub</a></nav><hr/><divid="topbar"><span>6. Interaction with Documenter.jl</span><aclass="fa fa-bars"href="#"></a></div></header><h1><aclass="nav-anchor"id="Interaction-with-Documenter-1"href="#Interaction-with-Documenter-1"><strong>6.</strong> Interaction with Documenter.jl</a></h1><p><code>Examples.jl</code> can be used for any purpose, it spits out regular markdown files, and notebooks. Typically, though, these files will be used to render documentation for your package. The generators (<ahref="outputformats.html#Examples.markdown"><code>Examples.markdown</code></a>, <ahref="outputformats.html#Examples.notebook"><code>Examples.notebook</code></a> and <ahref="outputformats.html#Examples.script"><code>Examples.script</code></a>) supports a keyword argument <code>documenter</code> that lets the generator perform some extra things, keeping in mind that the generated files will, eventually, be used with Documenter.jl. So lets take a look at what will happen if we set <code>documenter = true</code>:</p><p><ahref="outputformats.html#Examples.markdown"><code>Examples.markdown</code></a>:</p><ul><li>The default code fence will change from<pre><codeclass="language-none">```julia
```</code></pre></li><li>The following <code>@meta</code> block will be added to the top of the markdown page, which redirects the "Edit on GitHub" link on the top of the page to the <em>source file</em> rather than the generated <code>.md</code> file:<pre><codeclass="language-none">```@meta
```</code></pre></li></ul><p><ahref="outputformats.html#Examples.notebook"><code>Examples.notebook</code></a>:</p><ul><li>Documenter style <code>@ref</code>s and <code>@id</code> will be removed. This means that you can use <code>@ref</code> and <code>@id</code> in the source file without them leaking to the notebook.</li></ul><footer><hr/><aclass="previous"href="customprocessing.html"><spanclass="direction">Previous</span><spanclass="title"><strong>5.</strong> Custom pre- and post-processing</span></a><aclass="next"href="generated/example.html"><spanclass="direction">Next</span><spanclass="title"><strong>7.</strong> Example</span></a></footer></article></body></html>
@ -17,4 +17,4 @@ Here is an example with some code
```@example
```@example
x = sin.(cos.([1, 2, 3]))
x = sin.(cos.([1, 2, 3]))
y = x.^2 - x
y = x.^2 - x
```</code></pre><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="Examples.markdown"href="#Examples.markdown"><code>Examples.markdown</code></a> — <spanclass="docstring-category">Function</span>.</div><div><div><pre><codeclass="language-none">Examples.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><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. Defaults to the filename of <code>inputfile</code>.</li><li><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>.</li><li><code>codefence</code>: A <code>Pair</code> of opening and closing code fence. Defaults to<pre><codeclass="language-none">"```@example $(name)" =>"```"</code></pre></li><li><code>documenter</code>: boolean that says if the output is intended to use with Documenter.jl. Defaults to <code>false</code>. See the the manual section on <ahref="documenter.html#Interaction-with-Documenter-1">Interaction with Documenter</a>.</li></ul></div></div><aclass="source-link"target="_blank"href="https://github.com/fredrikekre/Examples.jl/blob/e0d090e4ed7f4310b1007bffbce0f65196d08f37/src/Examples.jl#L160-L179">source</a></section><h2><aclass="nav-anchor"id="Notebook-output-1"href="#Notebook-output-1"><strong>4.2.</strong> Notebook output</a></h2><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="Examples.notebook"href="#Examples.notebook"><code>Examples.notebook</code></a> — <spanclass="docstring-category">Function</span>.</div><div><div><pre><codeclass="language-none">Examples.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><code>name</code>: name of the output file, excluding <code>.ipynb</code>. Defaults to the filename of <code>inputfile</code>.</li><li><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>.</li><li><code>execute</code>: a boolean deciding if the generated notebook should also be executed or not. Defaults to <code>false</code>.</li><li><code>documenter</code>: boolean that says if the source contains Documenter.jl specific things to filter out during notebook generation. Defaults to <code>false</code>. See the the manual section on <ahref="documenter.html#Interaction-with-Documenter-1">Interaction with Documenter</a>.</li></ul></div></div><aclass="source-link"target="_blank"href="https://github.com/fredrikekre/Examples.jl/blob/e0d090e4ed7f4310b1007bffbce0f65196d08f37/src/Examples.jl#L250-L266">source</a></section><h2><aclass="nav-anchor"id="Script-output-1"href="#Script-output-1"><strong>4.3.</strong> Script output</a></h2><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="Examples.script"href="#Examples.script"><code>Examples.script</code></a> — <spanclass="docstring-category">Function</span>.</div><div><div><pre><codeclass="language-none">Examples.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><code>name</code>: name of the output file, excluding <code>.jl</code>. Defaults to the filename of <code>inputfile</code>.</li><li><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>.</li></ul></div></div><aclass="source-link"target="_blank"href="https://github.com/fredrikekre/Examples.jl/blob/e0d090e4ed7f4310b1007bffbce0f65196d08f37/src/Examples.jl#L93-L104">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>
```</code></pre><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="Examples.markdown"href="#Examples.markdown"><code>Examples.markdown</code></a> — <spanclass="docstring-category">Function</span>.</div><div><div><pre><codeclass="language-none">Examples.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><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. Defaults to the filename of <code>inputfile</code>.</li><li><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>.</li><li><code>codefence</code>: A <code>Pair</code> of opening and closing code fence. Defaults to<pre><codeclass="language-none">"```julia" =>"```"</code></pre>if <code>documenter = false</code> and<pre><codeclass="language-none">"```@example $(name)" =>"```"</code></pre>if <code>documenter = true</code>.</li><li><code>documenter</code>: boolean that says if the output is intended to use with Documenter.jl. Defaults to <code>false</code>. See the the manual section on <ahref="documenter.html#Interaction-with-Documenter-1">Interaction with Documenter</a>.</li></ul></div></div><aclass="source-link"target="_blank"href="https://github.com/fredrikekre/Examples.jl/blob/ac317e6cc42587b921a19f3dd5c16f2c8ea84567/src/Examples.jl#L160-L184">source</a></section><h2><aclass="nav-anchor"id="Notebook-output-1"href="#Notebook-output-1"><strong>4.2.</strong> Notebook output</a></h2><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="Examples.notebook"href="#Examples.notebook"><code>Examples.notebook</code></a> — <spanclass="docstring-category">Function</span>.</div><div><div><pre><codeclass="language-none">Examples.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><code>name</code>: name of the output file, excluding <code>.ipynb</code>. Defaults to the filename of <code>inputfile</code>.</li><li><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>.</li><li><code>execute</code>: a boolean deciding if the generated notebook should also be executed or not. Defaults to <code>false</code>.</li><li><code>documenter</code>: boolean that says if the source contains Documenter.jl specific things to filter out during notebook generation. Defaults to <code>false</code>. See the the manual section on <ahref="documenter.html#Interaction-with-Documenter-1">Interaction with Documenter</a>.</li></ul></div></div><aclass="source-link"target="_blank"href="https://github.com/fredrikekre/Examples.jl/blob/ac317e6cc42587b921a19f3dd5c16f2c8ea84567/src/Examples.jl#L267-L283">source</a></section><h2><aclass="nav-anchor"id="Script-output-1"href="#Script-output-1"><strong>4.3.</strong> Script output</a></h2><sectionclass="docstring"><divclass="docstring-header"><aclass="docstring-binding"id="Examples.script"href="#Examples.script"><code>Examples.script</code></a> — <spanclass="docstring-category">Function</span>.</div><div><div><pre><codeclass="language-none">Examples.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><code>name</code>: name of the output file, excluding <code>.jl</code>. Defaults to the filename of <code>inputfile</code>.</li><li><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>.</li></ul></div></div><aclass="source-link"target="_blank"href="https://github.com/fredrikekre/Examples.jl/blob/ac317e6cc42587b921a19f3dd5c16f2c8ea84567/src/Examples.jl#L93-L104">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>
@ -157,7 +157,7 @@ var documenterSearchIndex = {"docs": [
"page":"4. Output formats",
"page":"4. Output formats",
"title":"Examples.markdown",
"title":"Examples.markdown",
"category":"function",
"category":"function",
"text":"Examples.markdown(inputfile, outputdir; kwargs...)\n\nGenerate a markdown file from inputfile and write the result to the directoryoutputdir.\n\nKeyword arguments:\n\nname: name of the output file, excluding .md. name is also used to name all the @example blocks. Defaults to the filename of inputfile.\npreprocess, postprocess: custom pre- and post-processing functions, see the Custom pre- and post-processing section of the manual. Defaults to identity.\ncodefence: A Pair of opening and closing code fence. Defaults to\n\"```@example $(name)\" => \"```\"\ndocumenter: boolean that says if the output is intended to use with Documenter.jl. Defaults to false. See the the manual section on Interaction with Documenter.\n\n\n\n\n\n"
"text":"Examples.markdown(inputfile, outputdir; kwargs...)\n\nGenerate a markdown file from inputfile and write the result to the directoryoutputdir.\n\nKeyword arguments:\n\nname: name of the output file, excluding .md. name is also used to name all the @example blocks. Defaults to the filename of inputfile.\npreprocess, postprocess: custom pre- and post-processing functions, see the Custom pre- and post-processing section of the manual. Defaults to identity.\ncodefence: A Pair of opening and closing code fence. Defaults to\n\"```julia\" => \"```\"\nif documenter = false and\n\"```@example $(name)\" => \"```\"\nif documenter = true.\ndocumenter: boolean that says if the output is intended to use with Documenter.jl. Defaults to false. See the the manual section on Interaction with Documenter.\n\n\n\n\n\n"
},
},
{
{
@ -229,7 +229,7 @@ var documenterSearchIndex = {"docs": [
"page":"6. Interaction with Documenter.jl",
"page":"6. Interaction with Documenter.jl",
"title":"6. Interaction with Documenter.jl",
"title":"6. Interaction with Documenter.jl",
"category":"section",
"category":"section",
"text":"TBW"
"text":"Examples.jl can be used for any purpose, it spits out regular markdown files, and notebooks. Typically, though, these files will be used to render documentation for your package. The generators (Examples.markdown, Examples.notebook and Examples.script) supports a keyword argument documenter that lets the generator perform some extra things, keeping in mind that the generated files will, eventually, be used with Documenter.jl. So lets take a look at what will happen if we set documenter = true:Examples.markdown:The default code fence will change from\n```julia\n# code\n```\nto Documenters @example blocks:\n```@examples $(name)\n# code\n```\nThe following @meta block will be added to the top of the markdown page, which redirects the \"Edit on GitHub\" link on the top of the page to the source file rather than the generated .md file:\n```@meta\nEditURL = \"$(relpath(inputfile, outputdir))\"\n```Examples.notebook:Documenter style @refs and @id will be removed. This means that you can use @ref and @id in the source file without them leaking to the notebook."
},
},
{
{
@ -237,7 +237,7 @@ var documenterSearchIndex = {"docs": [