|
|
<!DOCTYPE html><HTML lang="en"><head><meta charset="UTF-8"/><meta content="width=device-width, initial-scale=1.0" name="viewport"/><title>6. Interaction with Documenter.jl · Literate.jl</title><link href="https://fredrikekre.github.io/Literate.jl/v2/" rel="canonical"/><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 data-main="../assets/documenter.js" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link href="../assets/documenter.css" rel="stylesheet" type="text/css"/><link href="../assets/custom.css" rel="stylesheet" type="text/css"/><script data-outdated-warner="">function maybeAddWarning () { |
|
|
const head = document.getElementsByTagName('head')[0]; |
|
|
|
|
|
// Add a noindex meta tag (unless one exists) so that search engines don't index this version of the docs. |
|
|
if (document.body.querySelector('meta[name="robots"]') === null) { |
|
|
const meta = document.createElement('meta'); |
|
|
meta.name = 'robots'; |
|
|
meta.content = 'noindex'; |
|
|
|
|
|
head.appendChild(meta); |
|
|
}; |
|
|
|
|
|
// Add a stylesheet to avoid inline styling |
|
|
const style = document.createElement('style'); |
|
|
style.type = 'text/css'; |
|
|
style.appendChild(document.createTextNode('.outdated-warning-overlay { position: fixed; top: 0; left: 0; right: 0; box-shadow: 0 0 10px rgba(0, 0, 0, 0.3); z-index: 999; background-color: #ffaba7; color: rgba(0, 0, 0, 0.7); border-bottom: 3px solid #da0b00; padding: 10px 35px; text-align: center; font-size: 15px; } .outdated-warning-overlay .outdated-warning-closer { position: absolute; top: calc(50% - 10px); right: 18px; cursor: pointer; width: 12px; } .outdated-warning-overlay a { color: #2e63b8; } .outdated-warning-overlay a:hover { color: #363636; }')); |
|
|
head.appendChild(style); |
|
|
|
|
|
const div = document.createElement('div'); |
|
|
div.classList.add('outdated-warning-overlay'); |
|
|
const closer = document.createElement('div'); |
|
|
closer.classList.add('outdated-warning-closer'); |
|
|
|
|
|
// Icon by font-awesome (license: https://fontawesome.com/license, link: https://fontawesome.com/icons/times?style=solid) |
|
|
closer.innerHTML = '<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="times" class="svg-inline--fa fa-times fa-w-11" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512"><path fill="currentColor" d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"></path></svg>'; |
|
|
closer.addEventListener('click', function () { |
|
|
document.body.removeChild(div); |
|
|
}); |
|
|
let href = '/'; |
|
|
if (window.documenterBaseURL) { |
|
|
href = window.documenterBaseURL + '/../'; |
|
|
} |
|
|
div.innerHTML = 'This is an old version of the documentation. <br> <a href="' + href + '">Go to the newest version</a>.'; |
|
|
div.appendChild(closer); |
|
|
document.body.appendChild(div); |
|
|
}; |
|
|
|
|
|
if (document.readyState === 'loading') { |
|
|
document.addEventListener('DOMContentLoaded', maybeAddWarning); |
|
|
} else { |
|
|
maybeAddWarning(); |
|
|
}; |
|
|
</script></head><body><nav class="toc"><a href="../"><img alt="Literate.jl logo" class="logo" src="../assets/logo.png"/></a><h1>Literate.jl</h1><select id="version-selector" onchange="window.location.href=this.value" style="visibility: hidden"></select><form action="../search/" class="search" id="search-form"><input id="search-query" name="q" placeholder="Search docs" type="text"/></form><ul><li><a class="toctext" href="../"><strong>1.</strong> Introduction</a></li><li><a class="toctext" href="../fileformat/"><strong>2.</strong> File Format</a></li><li><a class="toctext" href="../pipeline/"><strong>3.</strong> Processing pipeline</a></li><li><a class="toctext" href="../outputformats/"><strong>4.</strong> Output Formats</a></li><li><a class="toctext" href="../customprocessing/"><strong>5.</strong> Custom pre- and post-processing</a></li><li class="current"><a class="toctext" href=""><strong>6.</strong> Interaction with Documenter.jl</a><ul class="internal"></ul></li><li><a class="toctext" href="../generated/example/"><strong>7.</strong> Example</a></li></ul></nav><article id="docs"><header><nav><ul><li><a href=""><strong>6.</strong> Interaction with Documenter.jl</a></li></ul><a class="edit-page" href="https://github.com/fredrikekre/Literate.jl/blob/master/docs/src/documenter.md"><span class="fa"></span> Edit on GitHub</a></nav><hr/><div id="topbar"><span>6. Interaction with Documenter.jl</span><a class="fa fa-bars" href="#"></a></div></header><h1><a class="nav-anchor" href="#Interaction-with-Documenter-1" id="Interaction-with-Documenter-1"><strong>6.</strong> Interaction with Documenter.jl</a></h1><p>Literate 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 (<a href="../outputformats/#Literate.markdown"><code>Literate.markdown</code></a>, <a href="../outputformats/#Literate.notebook"><code>Literate.notebook</code></a> and <a href="../outputformats/#Literate.script"><code>Literate.script</code></a>) supports a keyword argument <code>documenter</code> that lets the generator perform some extra things, keeping in mind that the source code have been written with Documenter.jl in mind. So lets take a look at what will happen if we set <code>documenter = true</code>:</p><h3><a class="nav-anchor" href="#[Literate.markdown](@ref):-1" id="[Literate.markdown](@ref):-1"></a><a href="../outputformats/#Literate.markdown"><code>Literate.markdown</code></a>:</h3><ul><li>The default code fence will change from<pre><code class="language-none">```julia |
|
|
# code |
|
|
```</code></pre>to Documenters <code>@example</code> blocks:<pre><code class="language-none">```@examples $(name) |
|
|
# code |
|
|
```</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><code class="language-none">```@meta |
|
|
EditURL = "$(relpath(inputfile, outputdir))" |
|
|
```</code></pre></li></ul><h3><a class="nav-anchor" href="#[Literate.notebook](@ref):-1" id="[Literate.notebook](@ref):-1"></a><a href="../outputformats/#Literate.notebook"><code>Literate.notebook</code></a>:</h3><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><li>Documenter style markdown math<pre><code class="language-none">```math |
|
|
\int f dx |
|
|
```</code></pre>is replaced with notebook compatible<pre><code class="language-none">$$ |
|
|
\int f dx |
|
|
$$</code></pre></li></ul><h3><a class="nav-anchor" href="#[Literate.script](@ref):-1" id="[Literate.script](@ref):-1"></a><a href="../outputformats/#Literate.script"><code>Literate.script</code></a>:</h3><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 script.</li></ul><footer><hr/><a class="previous" href="../customprocessing/"><span class="direction">Previous</span><span class="title"><strong>5.</strong> Custom pre- and post-processing</span></a><a class="next" href="../generated/example/"><span class="direction">Next</span><span class="title"><strong>7.</strong> Example</span></a></footer></article></body></HTML> |