You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
9.9 KiB

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>6. Interaction with Documenter.jl · Literate.jl</title><meta name="title" content="6. Interaction with Documenter.jl · Literate.jl"/><meta property="og:title" content="6. Interaction with Documenter.jl · Literate.jl"/><meta property="twitter:title" content="6. Interaction with Documenter.jl · Literate.jl"/><meta name="description" content="Documentation for Literate.jl."/><meta property="og:description" content="Documentation for Literate.jl."/><meta property="twitter:description" content="Documentation for Literate.jl."/><meta property="og:url" content="https://fredrikekre.github.io/Literate.jl/v2/documenter/"/><meta property="twitter:url" content="https://fredrikekre.github.io/Literate.jl/v2/documenter/"/><link rel="canonical" href="https://fredrikekre.github.io/Literate.jl/v2/documenter/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../assets/search.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/custom.css" rel="stylesheet" type="text/css"/><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="Literate.jl logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">Literate.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../"><strong>1.</strong> Introduction</a></li><li><a class="tocitem" href="../fileformat/"><strong>2.</strong> File format</a></li><li><a class="tocitem" href="../pipeline/"><strong>3.</strong> Processing pipeline</a></li><li><a class="tocitem" href="../outputformats/"><strong>4.</strong> Output formats</a></li><li><a class="tocitem" href="../customprocessing/"><strong>5.</strong> Custom pre- and post-processing</a></li><li class="is-active"><a class="tocitem" href><strong>6.</strong> Interaction with Documenter.jl</a></li><li><a class="tocitem" href="../tips/"><strong>7.</strong> Tips and tricks</a></li><li><a class="tocitem" href="../generated/example/"><strong>8.</strong> Example</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href><strong>6.</strong> Interaction with Documenter.jl</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href><strong>6.</strong> Interaction with Documenter.jl</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/fredrikekre/Literate.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/fredrikekre/Literate.jl/blob/master/docs/src/documenter.md" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Interaction-with-Documenter"><a class="docs-heading-anchor" href="#Interaction-with-Documenter"><strong>6.</strong> Interaction with Documenter.jl</a><a id="Interaction-with-Documenter-1"></a><a class="docs-heading-anchor-permalink" href="#Interaction-with-Documenter" title="Permalink"></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 let&#39;s take a look at what will happen if we set <code>documenter = true</code>:</p><h3 id="[Literate.markdown](@ref):"><a class="docs-heading-anchor" href="#[Literate.markdown](@ref):"><a href="../outputformats/#Literate.markdown"><code>Literate.markdown</code></a>:</a><a id="[Literate.markdown](@ref):-1"></a><a class="docs-heading-anchor-permalink" href="#[Literate.markdown](@ref):" title="Permalink"></a></h3><ul><li>The default code fence will change from<pre><code class="nohighlight hljs">```julia
# code
```</code></pre>to Documenters <code>@example</code> blocks:<pre><code class="nohighlight hljs">```@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 &quot;Edit on GitHub&quot; link on the top of the page to the <em>source file</em> rather than the generated <code>.md</code> file:<pre><code class="nohighlight hljs">```@meta
EditURL = &quot;$(relpath(inputfile, outputdir))&quot;
```</code></pre></li></ul><h3 id="[Literate.notebook](@ref):"><a class="docs-heading-anchor" href="#[Literate.notebook](@ref):"><a href="../outputformats/#Literate.notebook"><code>Literate.notebook</code></a>:</a><a id="[Literate.notebook](@ref):-1"></a><a class="docs-heading-anchor-permalink" href="#[Literate.notebook](@ref):" title="Permalink"></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="nohighlight hljs">```math
\int f dx
```</code></pre>is replaced with notebook compatible<pre><code class="nohighlight hljs">$$
\int f dx
$$</code></pre></li><li>Whereas Documenter requires HTML blocks to be escaped<pre><code class="nohighlight hljs">```@raw html
&lt;tag&gt;...&lt;/tag&gt;
```</code></pre>the output to a notebook markdown cell will be raw HTML<pre><code class="nohighlight hljs">&lt;tag&gt;...&lt;/tag&gt;</code></pre></li></ul><h3 id="[Literate.script](@ref):"><a class="docs-heading-anchor" href="#[Literate.script](@ref):"><a href="../outputformats/#Literate.script"><code>Literate.script</code></a>:</a><a id="[Literate.script](@ref):-1"></a><a class="docs-heading-anchor-permalink" href="#[Literate.script](@ref):" title="Permalink"></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></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../customprocessing/">« <strong>5.</strong> Custom pre- and post-processing</a><a class="docs-footer-nextpage" href="../tips/"><strong>7.</strong> Tips and tricks »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.28.0-DEV on <span class="colophon-date" title="Tuesday 5 September 2023 07:31">Tuesday 5 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>