Browse Source

build based on 142c511

gh-pages
autodocs 7 years ago
parent
commit
cd2e31193c
  1. 25
      dev/customprocessing.html
  2. 84
      dev/generated/example.html
  3. 172
      dev/generated/example.ipynb
  4. 4
      dev/generated/notebook.ipynb
  5. 4
      dev/outputformats.html
  6. 18
      dev/search_index.js

25
dev/customprocessing.html

@ -1,8 +1,29 @@ @@ -1,8 +1,29 @@
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>5. Custom pre- and post-processing · Literate.jl</title><link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css" rel="stylesheet" type="text/css"/><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js" data-main="assets/documenter.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link href="assets/documenter.css" rel="stylesheet" type="text/css"/></head><body><nav class="toc"><a href="index.html"><img class="logo" src="assets/logo.png" alt="Literate.jl logo"/></a><h1>Literate.jl</h1><select id="version-selector" onChange="window.location.href=this.value" style="visibility: hidden"></select><form class="search" id="search-form" action="search.html"><input id="search-query" name="q" type="text" placeholder="Search docs"/></form><ul><li><a class="toctext" href="index.html"><strong>1.</strong> Introduction</a></li><li><a class="toctext" href="fileformat.html"><strong>2.</strong> File Format</a></li><li><a class="toctext" href="pipeline.html"><strong>3.</strong> Processing pipeline</a></li><li><a class="toctext" href="outputformats.html"><strong>4.</strong> Output Formats</a></li><li class="current"><a class="toctext" href="customprocessing.html"><strong>5.</strong> Custom pre- and post-processing</a><ul class="internal"></ul></li><li><a class="toctext" href="documenter.html"><strong>6.</strong> Interaction with Documenter.jl</a></li><li><a class="toctext" href="generated/example.html"><strong>7.</strong> Example</a></li></ul></nav><article id="docs"><header><nav><ul><li><a href="customprocessing.html"><strong>5.</strong> Custom pre- and post-processing</a></li></ul><a class="edit-page" href="https://github.com/fredrikekre/Literate.jl/blob/master/docs/src/customprocessing.md"><span class="fa"></span> Edit on GitHub</a></nav><hr/><div id="topbar"><span>5. Custom pre- and post-processing</span><a class="fa fa-bars" href="#"></a></div></header><h1><a class="nav-anchor" id="Custom-pre-and-post-processing-1" href="#Custom-pre-and-post-processing-1"><strong>5.</strong> Custom pre- and post-processing</a></h1><p>Since all packages are different, and may have different demands on how to create a nice example for the documentation it is important that the package maintainer does not feel limited by the by default provided syntax that this package offers. While you can generally come a long way by utilizing <a href="fileformat.html#Filtering-Lines-1">line filtering</a> there might be situations where you need to manually hook into the generation and change things. In Literate this is done by letting the user supply custom pre- and post-processing functions that may do transformation of the content.</p><p>All of the generators (<a href="outputformats.html#Literate.markdown"><code>Literate.markdown</code></a>, <a href="outputformats.html#Literate.notebook"><code>Literate.notebook</code></a> and <a href="outputformats.html#Literate.script"><code>Literate.script</code></a>) accepts <code>preprocess</code> and <code>postprocess</code> keyword arguments. The default &quot;transformation&quot; is the <code>identity</code> function. The input to the transformation functions is a <code>String</code>, and the output should be the transformed <code>String</code>.</p><p><code>preprocess</code> is sent the raw input that is read from the source file (<a href="pipeline.html#Pre-processing-1">modulo the default line ending transformation</a>). <code>postprocess</code> is given different things depending on the output: For markdown and script output <code>postprocess</code> is given the content <code>String</code> just before writing it to the output file, but for notebook output <code>postprocess</code> is given the dictionary representing the notebook, since, in general, this is more useful.</p><p>As an example, lets say we want to splice the date of generation into the output. We could of course update our source file before generating the docs, but we could instead use a <code>preprocess</code> function that splices the date into the source for us. Consider the following source file:</p><pre><code class="language-julia"># # Example
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>5. Custom pre- and post-processing · Literate.jl</title><link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css" rel="stylesheet" type="text/css"/><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js" data-main="assets/documenter.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link href="assets/documenter.css" rel="stylesheet" type="text/css"/></head><body><nav class="toc"><a href="index.html"><img class="logo" src="assets/logo.png" alt="Literate.jl logo"/></a><h1>Literate.jl</h1><select id="version-selector" onChange="window.location.href=this.value" style="visibility: hidden"></select><form class="search" id="search-form" action="search.html"><input id="search-query" name="q" type="text" placeholder="Search docs"/></form><ul><li><a class="toctext" href="index.html"><strong>1.</strong> Introduction</a></li><li><a class="toctext" href="fileformat.html"><strong>2.</strong> File Format</a></li><li><a class="toctext" href="pipeline.html"><strong>3.</strong> Processing pipeline</a></li><li><a class="toctext" href="outputformats.html"><strong>4.</strong> Output Formats</a></li><li class="current"><a class="toctext" href="customprocessing.html"><strong>5.</strong> Custom pre- and post-processing</a><ul class="internal"></ul></li><li><a class="toctext" href="documenter.html"><strong>6.</strong> Interaction with Documenter.jl</a></li><li><a class="toctext" href="generated/example.html"><strong>7.</strong> Example</a></li></ul></nav><article id="docs"><header><nav><ul><li><a href="customprocessing.html"><strong>5.</strong> Custom pre- and post-processing</a></li></ul><a class="edit-page" href="https://github.com/fredrikekre/Literate.jl/blob/master/docs/src/customprocessing.md"><span class="fa"></span> Edit on GitHub</a></nav><hr/><div id="topbar"><span>5. Custom pre- and post-processing</span><a class="fa fa-bars" href="#"></a></div></header><h1><a class="nav-anchor" id="Custom-pre-and-post-processing-1" href="#Custom-pre-and-post-processing-1"><strong>5.</strong> Custom pre- and post-processing</a></h1><p>Since all packages are different, and may have different demands on how to create a nice example for the documentation it is important that the package maintainer does not feel limited by the by default provided syntax that this package offers. While you can generally come a long way by utilizing <a href="fileformat.html#Filtering-Lines-1">line filtering</a> there might be situations where you need to manually hook into the generation and change things. In Literate this is done by letting the user supply custom pre- and post-processing functions that may do transformation of the content.</p><p>All of the generators (<a href="outputformats.html#Literate.markdown"><code>Literate.markdown</code></a>, <a href="outputformats.html#Literate.notebook"><code>Literate.notebook</code></a> and <a href="outputformats.html#Literate.script"><code>Literate.script</code></a>) accepts <code>preprocess</code> and <code>postprocess</code> keyword arguments. The default &quot;transformation&quot; is the <code>identity</code> function. The input to the transformation functions is a <code>String</code>, and the output should be the transformed <code>String</code>.</p><p><code>preprocess</code> is sent the raw input that is read from the source file (<a href="pipeline.html#Pre-processing-1">modulo the default line ending transformation</a>). <code>postprocess</code> is given different things depending on the output: For markdown and script output <code>postprocess</code> is given the content <code>String</code> just before writing it to the output file, but for notebook output <code>postprocess</code> is given the dictionary representing the notebook, since, in general, this is more useful.</p><h3><a class="nav-anchor" id="Example:-Adding-current-date-1" href="#Example:-Adding-current-date-1">Example: Adding current date</a></h3><p>As an example, lets say we want to splice the date of generation into the output. We could of course update our source file before generating the docs, but we could instead use a <code>preprocess</code> function that splices the date into the source for us. Consider the following source file:</p><pre><code class="language-julia"># # Example
# This example was generated DATEOFTODAY
x = 1 // 3</code></pre><p>where <code>DATEOFTODAY</code> is a placeholder, to make it easier for our <code>preprocess</code> function to find the location. Now, lets define the <code>preprocess</code> function, for example</p><pre><code class="language-julia">function update_date(content)
content = replace(content, &quot;DATEOFTODAY&quot; =&gt; Date(now()))
return content
end</code></pre><p>which would replace every occurrence of <code>&quot;DATEOFTODAY&quot;</code> with the current date. We would now simply give this function to the generator, for example:</p><pre><code class="language-julia">Literate.markdown(&quot;input.jl&quot;, &quot;outputdir&quot;; preprocess = update_date)</code></pre><footer><hr/><a class="previous" href="outputformats.html"><span class="direction">Previous</span><span class="title"><strong>4.</strong> Output Formats</span></a><a class="next" href="documenter.html"><span class="direction">Next</span><span class="title"><strong>6.</strong> Interaction with Documenter.jl</span></a></footer></article></body></html>
end</code></pre><p>which would replace every occurrence of <code>&quot;DATEOFTODAY&quot;</code> with the current date. We would now simply give this function to the generator, for example:</p><pre><code class="language-julia">Literate.markdown(&quot;input.jl&quot;, &quot;outputdir&quot;; preprocess = update_date)</code></pre><h3><a class="nav-anchor" id="Example:-Replacing-include-calls-with-included-code-1" href="#Example:-Replacing-include-calls-with-included-code-1">Example: Replacing <code>include</code> calls with included code</a></h3><p>Let&#39;s say that we have some individual example files <code>file1, file2, ...</code> etc. that are <em>runnable</em> and also following the style of Literate. These files could be for example used in the test suite of your package.</p><p>We want to group them all into a single page in our documentation, but we do not want to copy paste the content of <code>file1, ...</code> for robustness: the files are included in the test suite and some changes may occur to them. We want these changes to also be reflected in the documentation.</p><p>A very easy way to do this is using <code>preprocess</code> to interchange <code>include</code> statements with file content. First, create a runnable <code>.jl</code> following the format of Literate</p><pre><code class="language-julia"># # Replace includes
# This is an example to replace `include` calls with the actual file content.
include(&quot;file1.jl&quot;)
# Cool, we just saw the result of the above code snippet. Here is one more:
include(&quot;file2.jl&quot;)</code></pre><p>Let&#39;s say we have saved this file as <code>examples.jl</code>. Then, you want to properly define a pre-processing function:</p><pre><code class="language-julia">function replace_includes(str)
included = [&quot;file1.jl&quot;, &quot;file2.jl&quot;]
# Here the path loads the files from their proper directory,
# which may not be the directory of the `examples.jl` file!
path = &quot;directory/to/example/files/&quot;
for ex in included
content = read(path*ex, String)
str = replace(str, &quot;include(\&quot;$(ex)\&quot;)&quot; =&gt; content)
end
return str
end</code></pre><p>(of course replace <code>included</code> with your respective files)</p><p>Finally, you simply pass this function to e.g. <a href="outputformats.html#Literate.markdown"><code>Literate.markdown</code></a> as</p><pre><code class="language-julia">Literate.markdown(&quot;examples.jl&quot;, &quot;path/to/save/markdown&quot;;
name = &quot;markdown_file_name&quot;, preprocess = replace_includes)</code></pre><p>and you will see that in the final output file (here <code>markdown_file_name.md</code>) the <code>include</code> statements are replaced with the actual code to be included!</p><p>This approach is used for example in the documentation of the Julia package <a href="https://github.com/JuliaDynamics/TimeseriesPrediction.jl"><code>TimeseriesPrediction</code></a>, see <a href="https://github.com/JuliaDynamics/DynamicalSystems.jl/blob/master/docs/src/tsprediction/stexamples.jl">here</a> and <a href="https://github.com/JuliaDynamics/DynamicalSystems.jl/blob/master/docs/make.jl#L11-L29">here for the generating script</a></p><footer><hr/><a class="previous" href="outputformats.html"><span class="direction">Previous</span><span class="title"><strong>4.</strong> Output Formats</span></a><a class="next" href="documenter.html"><span class="direction">Next</span><span class="title"><strong>6.</strong> Interaction with Documenter.jl</span></a></footer></article></body></html>

84
dev/generated/example.html

@ -17,114 +17,114 @@ y2 = cos.(x) @@ -17,114 +17,114 @@ y2 = cos.(x)
plot(x, [y1, y2])</code></pre><?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="600" height="400" viewBox="0 0 600 400">
<defs>
<clipPath id="clip2300">
<clipPath id="clip2900">
<rect x="0" y="0" width="600" height="400"/>
</clipPath>
</defs>
<polygon clip-path="url(#clip2300)" points="
<polygon clip-path="url(#clip2900)" points="
0,400 600,400 600,0 0,0
" fill="#ffffff" fill-opacity="1"/>
<defs>
<clipPath id="clip2301">
<clipPath id="clip2901">
<rect x="120" y="0" width="421" height="400"/>
</clipPath>
</defs>
<polygon clip-path="url(#clip2300)" points="
<polygon clip-path="url(#clip2900)" points="
23.622,384.252 580.315,384.252 580.315,11.811 23.622,11.811
" fill="#ffffff" fill-opacity="1"/>
<defs>
<clipPath id="clip2302">
<clipPath id="clip2902">
<rect x="23" y="11" width="558" height="373"/>
</clipPath>
</defs>
<polyline clip-path="url(#clip2302)" style="stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none" points="
<polyline clip-path="url(#clip2902)" style="stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none" points="
39.3775,384.252 39.3775,11.811
"/>
<polyline clip-path="url(#clip2302)" style="stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none" points="
<polyline clip-path="url(#clip2902)" style="stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none" points="
178.686,384.252 178.686,11.811
"/>
<polyline clip-path="url(#clip2302)" style="stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none" points="
<polyline clip-path="url(#clip2902)" style="stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none" points="
317.995,384.252 317.995,11.811
"/>
<polyline clip-path="url(#clip2302)" style="stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none" points="
<polyline clip-path="url(#clip2902)" style="stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none" points="
457.304,384.252 457.304,11.811
"/>
<polyline clip-path="url(#clip2302)" style="stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none" points="
<polyline clip-path="url(#clip2902)" style="stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none" points="
23.622,373.713 580.315,373.713
"/>
<polyline clip-path="url(#clip2302)" style="stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none" points="
<polyline clip-path="url(#clip2902)" style="stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none" points="
23.622,285.873 580.315,285.873
"/>
<polyline clip-path="url(#clip2302)" style="stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none" points="
<polyline clip-path="url(#clip2902)" style="stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none" points="
23.622,198.032 580.315,198.032
"/>
<polyline clip-path="url(#clip2302)" style="stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none" points="
<polyline clip-path="url(#clip2902)" style="stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none" points="
23.622,110.192 580.315,110.192
"/>
<polyline clip-path="url(#clip2302)" style="stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none" points="
<polyline clip-path="url(#clip2902)" style="stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none" points="
23.622,22.3518 580.315,22.3518
"/>
<polyline clip-path="url(#clip2300)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
<polyline clip-path="url(#clip2900)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
23.622,384.252 580.315,384.252
"/>
<polyline clip-path="url(#clip2300)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
<polyline clip-path="url(#clip2900)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
23.622,384.252 23.622,11.811
"/>
<polyline clip-path="url(#clip2300)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
<polyline clip-path="url(#clip2900)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
39.3775,384.252 39.3775,378.665
"/>
<polyline clip-path="url(#clip2300)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
<polyline clip-path="url(#clip2900)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
178.686,384.252 178.686,378.665
"/>
<polyline clip-path="url(#clip2300)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
<polyline clip-path="url(#clip2900)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
317.995,384.252 317.995,378.665
"/>
<polyline clip-path="url(#clip2300)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
<polyline clip-path="url(#clip2900)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
457.304,384.252 457.304,378.665
"/>
<polyline clip-path="url(#clip2300)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
<polyline clip-path="url(#clip2900)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
23.622,373.713 31.9724,373.713
"/>
<polyline clip-path="url(#clip2300)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
<polyline clip-path="url(#clip2900)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
23.622,285.873 31.9724,285.873
"/>
<polyline clip-path="url(#clip2300)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
<polyline clip-path="url(#clip2900)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
23.622,198.032 31.9724,198.032
"/>
<polyline clip-path="url(#clip2300)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
<polyline clip-path="url(#clip2900)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
23.622,110.192 31.9724,110.192
"/>
<polyline clip-path="url(#clip2300)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
<polyline clip-path="url(#clip2900)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
23.622,22.3518 31.9724,22.3518
"/>
<g clip-path="url(#clip2300)">
<g clip-path="url(#clip2900)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;" transform="rotate(0, 39.3775, 398.052)" x="39.3775" y="398.052">0</text>
</g>
<g clip-path="url(#clip2300)">
<g clip-path="url(#clip2900)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;" transform="rotate(0, 178.686, 398.052)" x="178.686" y="398.052">5</text>
</g>
<g clip-path="url(#clip2300)">
<g clip-path="url(#clip2900)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;" transform="rotate(0, 317.995, 398.052)" x="317.995" y="398.052">10</text>
</g>
<g clip-path="url(#clip2300)">
<g clip-path="url(#clip2900)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;" transform="rotate(0, 457.304, 398.052)" x="457.304" y="398.052">15</text>
</g>
<g clip-path="url(#clip2300)">
<g clip-path="url(#clip2900)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;" transform="rotate(0, 17.622, 378.213)" x="17.622" y="378.213">-1.0</text>
</g>
<g clip-path="url(#clip2300)">
<g clip-path="url(#clip2900)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;" transform="rotate(0, 17.622, 290.373)" x="17.622" y="290.373">-0.5</text>
</g>
<g clip-path="url(#clip2300)">
<g clip-path="url(#clip2900)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;" transform="rotate(0, 17.622, 202.532)" x="17.622" y="202.532">0.0</text>
</g>
<g clip-path="url(#clip2300)">
<g clip-path="url(#clip2900)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;" transform="rotate(0, 17.622, 114.692)" x="17.622" y="114.692">0.5</text>
</g>
<g clip-path="url(#clip2300)">
<g clip-path="url(#clip2900)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;" transform="rotate(0, 17.622, 26.8518)" x="17.622" y="26.8518">1.0</text>
</g>
<polyline clip-path="url(#clip2302)" style="stroke:#009af9; stroke-width:1; stroke-opacity:1; fill:none" points="
<polyline clip-path="url(#clip2902)" style="stroke:#009af9; stroke-width:1; stroke-opacity:1; fill:none" points="
39.3775,198.032 39.9032,194.718 40.4289,191.404 40.9546,188.093 41.4803,184.786 42.006,181.483 42.5318,178.186 43.0575,174.896 43.5832,171.615 44.1089,168.342
44.6346,165.081 45.1603,161.831 45.686,158.594 46.2117,155.371 46.7374,152.163 47.2631,148.971 47.7888,145.797 48.3145,142.642 48.8402,139.506 49.366,136.391
49.8917,133.298 50.4174,130.229 50.9431,127.183 51.4688,124.162 51.9945,121.168 52.5202,118.201 53.0459,115.263 53.5716,112.354 54.0973,109.475 54.623,106.629
@ -227,7 +227,7 @@ plot(x, [y1, y2])</code></pre><?xml version="1.0" encoding="utf-8"?> @@ -227,7 +227,7 @@ plot(x, [y1, y2])</code></pre><?xml version="1.0" encoding="utf-8"?>
559.828,227.723 560.354,224.45 560.88,221.169 561.405,217.879 561.931,214.582 562.457,211.279 562.982,207.972 563.508,204.661 564.034,201.347 564.56,198.032
"/>
<polyline clip-path="url(#clip2302)" style="stroke:#e26f46; stroke-width:1; stroke-opacity:1; fill:none" points="
<polyline clip-path="url(#clip2902)" style="stroke:#e26f46; stroke-width:1; stroke-opacity:1; fill:none" points="
39.3775,22.3518 39.9032,22.3831 40.4289,22.4769 40.9546,22.6332 41.4803,22.8519 42.006,23.133 42.5318,23.4764 43.0575,23.8819 43.5832,24.3495 44.1089,24.8788
44.6346,25.4698 45.1603,26.1222 45.686,26.8359 46.2117,27.6104 46.7374,28.4457 47.2631,29.3413 47.7888,30.297 48.3145,31.3124 48.8402,32.3871 49.366,33.5209
49.8917,34.7131 50.4174,35.9636 50.9431,37.2717 51.4688,38.637 51.9945,40.0591 52.5202,41.5375 53.0459,43.0715 53.5716,44.6608 54.0973,46.3046 54.623,48.0024
@ -330,22 +330,22 @@ plot(x, [y1, y2])</code></pre><?xml version="1.0" encoding="utf-8"?> @@ -330,22 +330,22 @@ plot(x, [y1, y2])</code></pre><?xml version="1.0" encoding="utf-8"?>
559.828,24.8788 560.354,24.3495 560.88,23.8819 561.405,23.4764 561.931,23.133 562.457,22.8519 562.982,22.6332 563.508,22.4769 564.034,22.3831 564.56,22.3518
"/>
<polygon clip-path="url(#clip2300)" points="
<polygon clip-path="url(#clip2900)" points="
489.608,78.051 562.315,78.051 562.315,32.691 489.608,32.691
" fill="#ffffff" fill-opacity="1"/>
<polyline clip-path="url(#clip2300)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
<polyline clip-path="url(#clip2900)" style="stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none" points="
489.608,78.051 562.315,78.051 562.315,32.691 489.608,32.691 489.608,78.051
"/>
<polyline clip-path="url(#clip2300)" style="stroke:#009af9; stroke-width:1; stroke-opacity:1; fill:none" points="
<polyline clip-path="url(#clip2900)" style="stroke:#009af9; stroke-width:1; stroke-opacity:1; fill:none" points="
495.608,47.811 531.608,47.811
"/>
<g clip-path="url(#clip2300)">
<g clip-path="url(#clip2900)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:start;" transform="rotate(0, 537.608, 52.311)" x="537.608" y="52.311">y1</text>
</g>
<polyline clip-path="url(#clip2300)" style="stroke:#e26f46; stroke-width:1; stroke-opacity:1; fill:none" points="
<polyline clip-path="url(#clip2900)" style="stroke:#e26f46; stroke-width:1; stroke-opacity:1; fill:none" points="
495.608,62.931 531.608,62.931
"/>
<g clip-path="url(#clip2300)">
<g clip-path="url(#clip2900)">
<text style="fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:start;" transform="rotate(0, 537.608, 67.431)" x="537.608" y="67.431">y2</text>
</g>
</svg>

172
dev/generated/example.ipynb

@ -187,114 +187,114 @@ @@ -187,114 +187,114 @@
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 600 400\">\n",
"<defs>\n",
" <clipPath id=\"clip2200\">\n",
" <clipPath id=\"clip2800\">\n",
" <rect x=\"0\" y=\"0\" width=\"600\" height=\"400\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip2200)\" points=\"\n",
"<polygon clip-path=\"url(#clip2800)\" points=\"\n",
"0,400 600,400 600,0 0,0 \n",
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip2201\">\n",
" <clipPath id=\"clip2801\">\n",
" <rect x=\"120\" y=\"0\" width=\"421\" height=\"400\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip2200)\" points=\"\n",
"<polygon clip-path=\"url(#clip2800)\" points=\"\n",
"23.622,384.252 580.315,384.252 580.315,11.811 23.622,11.811 \n",
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip2202\">\n",
" <clipPath id=\"clip2802\">\n",
" <rect x=\"23\" y=\"11\" width=\"558\" height=\"373\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polyline clip-path=\"url(#clip2202)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2802)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
" 39.3775,384.252 39.3775,11.811 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2202)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2802)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
" 178.686,384.252 178.686,11.811 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2202)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2802)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
" 317.995,384.252 317.995,11.811 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2202)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2802)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
" 457.304,384.252 457.304,11.811 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2202)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2802)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
" 23.622,373.713 580.315,373.713 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2202)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2802)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
" 23.622,285.873 580.315,285.873 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2202)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2802)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
" 23.622,198.032 580.315,198.032 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2202)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2802)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
" 23.622,110.192 580.315,110.192 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2202)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2802)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
" 23.622,22.3518 580.315,22.3518 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2200)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2800)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 23.622,384.252 580.315,384.252 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2200)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2800)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 23.622,384.252 23.622,11.811 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2200)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2800)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 39.3775,384.252 39.3775,378.665 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2200)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2800)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 178.686,384.252 178.686,378.665 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2200)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2800)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 317.995,384.252 317.995,378.665 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2200)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2800)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 457.304,384.252 457.304,378.665 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2200)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2800)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 23.622,373.713 31.9724,373.713 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2200)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2800)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 23.622,285.873 31.9724,285.873 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2200)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2800)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 23.622,198.032 31.9724,198.032 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2200)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2800)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 23.622,110.192 31.9724,110.192 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2200)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2800)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 23.622,22.3518 31.9724,22.3518 \n",
" \"/>\n",
"<g clip-path=\"url(#clip2200)\">\n",
"<g clip-path=\"url(#clip2800)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 39.3775, 398.052)\" x=\"39.3775\" y=\"398.052\">0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip2200)\">\n",
"<g clip-path=\"url(#clip2800)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 178.686, 398.052)\" x=\"178.686\" y=\"398.052\">5</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip2200)\">\n",
"<g clip-path=\"url(#clip2800)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 317.995, 398.052)\" x=\"317.995\" y=\"398.052\">10</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip2200)\">\n",
"<g clip-path=\"url(#clip2800)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 457.304, 398.052)\" x=\"457.304\" y=\"398.052\">15</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip2200)\">\n",
"<g clip-path=\"url(#clip2800)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 17.622, 378.213)\" x=\"17.622\" y=\"378.213\">-1.0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip2200)\">\n",
"<g clip-path=\"url(#clip2800)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 17.622, 290.373)\" x=\"17.622\" y=\"290.373\">-0.5</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip2200)\">\n",
"<g clip-path=\"url(#clip2800)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 17.622, 202.532)\" x=\"17.622\" y=\"202.532\">0.0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip2200)\">\n",
"<g clip-path=\"url(#clip2800)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 17.622, 114.692)\" x=\"17.622\" y=\"114.692\">0.5</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip2200)\">\n",
"<g clip-path=\"url(#clip2800)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 17.622, 26.8518)\" x=\"17.622\" y=\"26.8518\">1.0</text>\n",
"</g>\n",
"<polyline clip-path=\"url(#clip2202)\" style=\"stroke:#009af9; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2802)\" style=\"stroke:#009af9; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 39.3775,198.032 39.9032,194.718 40.4289,191.404 40.9546,188.093 41.4803,184.786 42.006,181.483 42.5318,178.186 43.0575,174.896 43.5832,171.615 44.1089,168.342 \n",
" 44.6346,165.081 45.1603,161.831 45.686,158.594 46.2117,155.371 46.7374,152.163 47.2631,148.971 47.7888,145.797 48.3145,142.642 48.8402,139.506 49.366,136.391 \n",
" 49.8917,133.298 50.4174,130.229 50.9431,127.183 51.4688,124.162 51.9945,121.168 52.5202,118.201 53.0459,115.263 53.5716,112.354 54.0973,109.475 54.623,106.629 \n",
@ -397,7 +397,7 @@ @@ -397,7 +397,7 @@
" 559.828,227.723 560.354,224.45 560.88,221.169 561.405,217.879 561.931,214.582 562.457,211.279 562.982,207.972 563.508,204.661 564.034,201.347 564.56,198.032 \n",
" \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2202)\" style=\"stroke:#e26f46; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2802)\" style=\"stroke:#e26f46; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 39.3775,22.3518 39.9032,22.3831 40.4289,22.4769 40.9546,22.6332 41.4803,22.8519 42.006,23.133 42.5318,23.4764 43.0575,23.8819 43.5832,24.3495 44.1089,24.8788 \n",
" 44.6346,25.4698 45.1603,26.1222 45.686,26.8359 46.2117,27.6104 46.7374,28.4457 47.2631,29.3413 47.7888,30.297 48.3145,31.3124 48.8402,32.3871 49.366,33.5209 \n",
" 49.8917,34.7131 50.4174,35.9636 50.9431,37.2717 51.4688,38.637 51.9945,40.0591 52.5202,41.5375 53.0459,43.0715 53.5716,44.6608 54.0973,46.3046 54.623,48.0024 \n",
@ -500,22 +500,22 @@ @@ -500,22 +500,22 @@
" 559.828,24.8788 560.354,24.3495 560.88,23.8819 561.405,23.4764 561.931,23.133 562.457,22.8519 562.982,22.6332 563.508,22.4769 564.034,22.3831 564.56,22.3518 \n",
" \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip2200)\" points=\"\n",
"<polygon clip-path=\"url(#clip2800)\" points=\"\n",
"489.608,78.051 562.315,78.051 562.315,32.691 489.608,32.691 \n",
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip2200)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2800)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 489.608,78.051 562.315,78.051 562.315,32.691 489.608,32.691 489.608,78.051 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2200)\" style=\"stroke:#009af9; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2800)\" style=\"stroke:#009af9; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 495.608,47.811 531.608,47.811 \n",
" \"/>\n",
"<g clip-path=\"url(#clip2200)\">\n",
"<g clip-path=\"url(#clip2800)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:start;\" transform=\"rotate(0, 537.608, 52.311)\" x=\"537.608\" y=\"52.311\">y1</text>\n",
"</g>\n",
"<polyline clip-path=\"url(#clip2200)\" style=\"stroke:#e26f46; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2800)\" style=\"stroke:#e26f46; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 495.608,62.931 531.608,62.931 \n",
" \"/>\n",
"<g clip-path=\"url(#clip2200)\">\n",
"<g clip-path=\"url(#clip2800)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:start;\" transform=\"rotate(0, 537.608, 67.431)\" x=\"537.608\" y=\"67.431\">y2</text>\n",
"</g>\n",
"</svg>\n"
@ -524,114 +524,114 @@ @@ -524,114 +524,114 @@
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 600 400\">\n",
"<defs>\n",
" <clipPath id=\"clip2100\">\n",
" <clipPath id=\"clip2700\">\n",
" <rect x=\"0\" y=\"0\" width=\"600\" height=\"400\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip2100)\" points=\"\n",
"<polygon clip-path=\"url(#clip2700)\" points=\"\n",
"0,400 600,400 600,0 0,0 \n",
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip2101\">\n",
" <clipPath id=\"clip2701\">\n",
" <rect x=\"120\" y=\"0\" width=\"421\" height=\"400\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polygon clip-path=\"url(#clip2100)\" points=\"\n",
"<polygon clip-path=\"url(#clip2700)\" points=\"\n",
"23.622,384.252 580.315,384.252 580.315,11.811 23.622,11.811 \n",
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip2102\">\n",
" <clipPath id=\"clip2702\">\n",
" <rect x=\"23\" y=\"11\" width=\"558\" height=\"373\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polyline clip-path=\"url(#clip2102)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2702)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
" 39.3775,384.252 39.3775,11.811 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2102)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2702)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
" 178.686,384.252 178.686,11.811 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2102)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2702)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
" 317.995,384.252 317.995,11.811 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2102)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2702)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
" 457.304,384.252 457.304,11.811 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2102)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2702)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
" 23.622,373.713 580.315,373.713 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2102)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2702)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
" 23.622,285.873 580.315,285.873 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2102)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2702)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
" 23.622,198.032 580.315,198.032 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2102)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2702)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
" 23.622,110.192 580.315,110.192 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2102)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2702)\" style=\"stroke:#000000; stroke-width:0.5; stroke-opacity:0.1; fill:none\" points=\"\n",
" 23.622,22.3518 580.315,22.3518 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2100)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2700)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 23.622,384.252 580.315,384.252 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2100)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2700)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 23.622,384.252 23.622,11.811 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2100)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2700)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 39.3775,384.252 39.3775,378.665 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2100)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2700)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 178.686,384.252 178.686,378.665 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2100)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2700)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 317.995,384.252 317.995,378.665 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2100)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2700)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 457.304,384.252 457.304,378.665 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2100)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2700)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 23.622,373.713 31.9724,373.713 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2100)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2700)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 23.622,285.873 31.9724,285.873 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2100)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2700)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 23.622,198.032 31.9724,198.032 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2100)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2700)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 23.622,110.192 31.9724,110.192 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2100)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2700)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 23.622,22.3518 31.9724,22.3518 \n",
" \"/>\n",
"<g clip-path=\"url(#clip2100)\">\n",
"<g clip-path=\"url(#clip2700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 39.3775, 398.052)\" x=\"39.3775\" y=\"398.052\">0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip2100)\">\n",
"<g clip-path=\"url(#clip2700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 178.686, 398.052)\" x=\"178.686\" y=\"398.052\">5</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip2100)\">\n",
"<g clip-path=\"url(#clip2700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 317.995, 398.052)\" x=\"317.995\" y=\"398.052\">10</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip2100)\">\n",
"<g clip-path=\"url(#clip2700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:middle;\" transform=\"rotate(0, 457.304, 398.052)\" x=\"457.304\" y=\"398.052\">15</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip2100)\">\n",
"<g clip-path=\"url(#clip2700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 17.622, 378.213)\" x=\"17.622\" y=\"378.213\">-1.0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip2100)\">\n",
"<g clip-path=\"url(#clip2700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 17.622, 290.373)\" x=\"17.622\" y=\"290.373\">-0.5</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip2100)\">\n",
"<g clip-path=\"url(#clip2700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 17.622, 202.532)\" x=\"17.622\" y=\"202.532\">0.0</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip2100)\">\n",
"<g clip-path=\"url(#clip2700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 17.622, 114.692)\" x=\"17.622\" y=\"114.692\">0.5</text>\n",
"</g>\n",
"<g clip-path=\"url(#clip2100)\">\n",
"<g clip-path=\"url(#clip2700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:end;\" transform=\"rotate(0, 17.622, 26.8518)\" x=\"17.622\" y=\"26.8518\">1.0</text>\n",
"</g>\n",
"<polyline clip-path=\"url(#clip2102)\" style=\"stroke:#009af9; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2702)\" style=\"stroke:#009af9; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 39.3775,198.032 39.9032,194.718 40.4289,191.404 40.9546,188.093 41.4803,184.786 42.006,181.483 42.5318,178.186 43.0575,174.896 43.5832,171.615 44.1089,168.342 \n",
" 44.6346,165.081 45.1603,161.831 45.686,158.594 46.2117,155.371 46.7374,152.163 47.2631,148.971 47.7888,145.797 48.3145,142.642 48.8402,139.506 49.366,136.391 \n",
" 49.8917,133.298 50.4174,130.229 50.9431,127.183 51.4688,124.162 51.9945,121.168 52.5202,118.201 53.0459,115.263 53.5716,112.354 54.0973,109.475 54.623,106.629 \n",
@ -734,7 +734,7 @@ @@ -734,7 +734,7 @@
" 559.828,227.723 560.354,224.45 560.88,221.169 561.405,217.879 561.931,214.582 562.457,211.279 562.982,207.972 563.508,204.661 564.034,201.347 564.56,198.032 \n",
" \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2102)\" style=\"stroke:#e26f46; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2702)\" style=\"stroke:#e26f46; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 39.3775,22.3518 39.9032,22.3831 40.4289,22.4769 40.9546,22.6332 41.4803,22.8519 42.006,23.133 42.5318,23.4764 43.0575,23.8819 43.5832,24.3495 44.1089,24.8788 \n",
" 44.6346,25.4698 45.1603,26.1222 45.686,26.8359 46.2117,27.6104 46.7374,28.4457 47.2631,29.3413 47.7888,30.297 48.3145,31.3124 48.8402,32.3871 49.366,33.5209 \n",
" 49.8917,34.7131 50.4174,35.9636 50.9431,37.2717 51.4688,38.637 51.9945,40.0591 52.5202,41.5375 53.0459,43.0715 53.5716,44.6608 54.0973,46.3046 54.623,48.0024 \n",
@ -837,22 +837,22 @@ @@ -837,22 +837,22 @@
" 559.828,24.8788 560.354,24.3495 560.88,23.8819 561.405,23.4764 561.931,23.133 562.457,22.8519 562.982,22.6332 563.508,22.4769 564.034,22.3831 564.56,22.3518 \n",
" \n",
" \"/>\n",
"<polygon clip-path=\"url(#clip2100)\" points=\"\n",
"<polygon clip-path=\"url(#clip2700)\" points=\"\n",
"489.608,78.051 562.315,78.051 562.315,32.691 489.608,32.691 \n",
" \" fill=\"#ffffff\" fill-opacity=\"1\"/>\n",
"<polyline clip-path=\"url(#clip2100)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2700)\" style=\"stroke:#000000; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 489.608,78.051 562.315,78.051 562.315,32.691 489.608,32.691 489.608,78.051 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip2100)\" style=\"stroke:#009af9; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2700)\" style=\"stroke:#009af9; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 495.608,47.811 531.608,47.811 \n",
" \"/>\n",
"<g clip-path=\"url(#clip2100)\">\n",
"<g clip-path=\"url(#clip2700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:start;\" transform=\"rotate(0, 537.608, 52.311)\" x=\"537.608\" y=\"52.311\">y1</text>\n",
"</g>\n",
"<polyline clip-path=\"url(#clip2100)\" style=\"stroke:#e26f46; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
"<polyline clip-path=\"url(#clip2700)\" style=\"stroke:#e26f46; stroke-width:1; stroke-opacity:1; fill:none\" points=\"\n",
" 495.608,62.931 531.608,62.931 \n",
" \"/>\n",
"<g clip-path=\"url(#clip2100)\">\n",
"<g clip-path=\"url(#clip2700)\">\n",
"<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:12; text-anchor:start;\" transform=\"rotate(0, 537.608, 67.431)\" x=\"537.608\" y=\"67.431\">y2</text>\n",
"</g>\n",
"</svg>\n"
@ -940,11 +940,11 @@ @@ -940,11 +940,11 @@
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.0.0"
"version": "1.0.1"
},
"kernelspec": {
"name": "julia-1.0",
"display_name": "Julia 1.0.0",
"display_name": "Julia 1.0.1",
"language": "julia"
}
},

4
dev/generated/notebook.ipynb

@ -88,11 +88,11 @@ @@ -88,11 +88,11 @@
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.0.0"
"version": "1.0.1"
},
"kernelspec": {
"name": "julia-1.0",
"display_name": "Julia 1.0.0",
"display_name": "Julia 1.0.1",
"language": "julia"
}
},

4
dev/outputformats.html

File diff suppressed because one or more lines are too long

18
dev/search_index.js

@ -213,7 +213,23 @@ var documenterSearchIndex = {"docs": [ @@ -213,7 +213,23 @@ var documenterSearchIndex = {"docs": [
"page": "5. Custom pre- and post-processing",
"title": "5. Custom pre- and post-processing",
"category": "section",
"text": "Since all packages are different, and may have different demands on how to create a nice example for the documentation it is important that the package maintainer does not feel limited by the by default provided syntax that this package offers. While you can generally come a long way by utilizing line filtering there might be situations where you need to manually hook into the generation and change things. In Literate this is done by letting the user supply custom pre- and post-processing functions that may do transformation of the content.All of the generators (Literate.markdown, Literate.notebook and Literate.script) accepts preprocess and postprocess keyword arguments. The default \"transformation\" is the identity function. The input to the transformation functions is a String, and the output should be the transformed String.preprocess is sent the raw input that is read from the source file (modulo the default line ending transformation). postprocess is given different things depending on the output: For markdown and script output postprocess is given the content String just before writing it to the output file, but for notebook output postprocess is given the dictionary representing the notebook, since, in general, this is more useful.As an example, lets say we want to splice the date of generation into the output. We could of course update our source file before generating the docs, but we could instead use a preprocess function that splices the date into the source for us. Consider the following source file:# # Example\n# This example was generated DATEOFTODAY\n\nx = 1 // 3where DATEOFTODAY is a placeholder, to make it easier for our preprocess function to find the location. Now, lets define the preprocess function, for examplefunction update_date(content)\n content = replace(content, \"DATEOFTODAY\" => Date(now()))\n return content\nendwhich would replace every occurrence of \"DATEOFTODAY\" with the current date. We would now simply give this function to the generator, for example:Literate.markdown(\"input.jl\", \"outputdir\"; preprocess = update_date)"
"text": "Since all packages are different, and may have different demands on how to create a nice example for the documentation it is important that the package maintainer does not feel limited by the by default provided syntax that this package offers. While you can generally come a long way by utilizing line filtering there might be situations where you need to manually hook into the generation and change things. In Literate this is done by letting the user supply custom pre- and post-processing functions that may do transformation of the content.All of the generators (Literate.markdown, Literate.notebook and Literate.script) accepts preprocess and postprocess keyword arguments. The default \"transformation\" is the identity function. The input to the transformation functions is a String, and the output should be the transformed String.preprocess is sent the raw input that is read from the source file (modulo the default line ending transformation). postprocess is given different things depending on the output: For markdown and script output postprocess is given the content String just before writing it to the output file, but for notebook output postprocess is given the dictionary representing the notebook, since, in general, this is more useful."
},
{
"location": "customprocessing.html#Example:-Adding-current-date-1",
"page": "5. Custom pre- and post-processing",
"title": "Example: Adding current date",
"category": "section",
"text": "As an example, lets say we want to splice the date of generation into the output. We could of course update our source file before generating the docs, but we could instead use a preprocess function that splices the date into the source for us. Consider the following source file:# # Example\n# This example was generated DATEOFTODAY\n\nx = 1 // 3where DATEOFTODAY is a placeholder, to make it easier for our preprocess function to find the location. Now, lets define the preprocess function, for examplefunction update_date(content)\n content = replace(content, \"DATEOFTODAY\" => Date(now()))\n return content\nendwhich would replace every occurrence of \"DATEOFTODAY\" with the current date. We would now simply give this function to the generator, for example:Literate.markdown(\"input.jl\", \"outputdir\"; preprocess = update_date)"
},
{
"location": "customprocessing.html#Example:-Replacing-include-calls-with-included-code-1",
"page": "5. Custom pre- and post-processing",
"title": "Example: Replacing include calls with included code",
"category": "section",
"text": "Let\'s say that we have some individual example files file1, file2, ... etc. that are runnable and also following the style of Literate. These files could be for example used in the test suite of your package.We want to group them all into a single page in our documentation, but we do not want to copy paste the content of file1, ... for robustness: the files are included in the test suite and some changes may occur to them. We want these changes to also be reflected in the documentation.A very easy way to do this is using preprocess to interchange include statements with file content. First, create a runnable .jl following the format of Literate# # Replace includes\n# This is an example to replace `include` calls with the actual file content.\n\ninclude(\"file1.jl\")\n\n# Cool, we just saw the result of the above code snippet. Here is one more:\n\ninclude(\"file2.jl\")Let\'s say we have saved this file as examples.jl. Then, you want to properly define a pre-processing function:function replace_includes(str)\n\n included = [\"file1.jl\", \"file2.jl\"]\n\n # Here the path loads the files from their proper directory,\n # which may not be the directory of the `examples.jl` file!\n path = \"directory/to/example/files/\"\n\n for ex in included\n content = read(path*ex, String)\n str = replace(str, \"include(\\\"$(ex)\\\")\" => content)\n end\n return str\nend(of course replace included with your respective files)Finally, you simply pass this function to e.g. Literate.markdown asLiterate.markdown(\"examples.jl\", \"path/to/save/markdown\";\n name = \"markdown_file_name\", preprocess = replace_includes)and you will see that in the final output file (here markdown_file_name.md) the include statements are replaced with the actual code to be included!This approach is used for example in the documentation of the Julia package TimeseriesPrediction, see here and here for the generating script"
},
{

Loading…
Cancel
Save