mirror of https://github.com/mpastell/Weave.jl
31 lines
9.5 KiB
HTML
31 lines
9.5 KiB
HTML
|
<!DOCTYPE html>
|
||
|
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Header Configuration · Weave.jl</title><link rel="canonical" href="http://weavejl.mpastell.com/stable/header/"/><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/5.11.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/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="../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"/><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></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit">Weave.jl</span></div><form class="docs-search" action="../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../">Weave.jl - Scientific Reports Using Julia</a></li><li><a class="tocitem" href="../getting_started/">Getting started</a></li><li><a class="tocitem" href="../usage/">Using Weave</a></li><li><a class="tocitem" href="../publish/">Publishing to HTML and PDF</a></li><li><a class="tocitem" href="../chunk_options/">Chunk Options</a></li><li class="is-active"><a class="tocitem" href>Header Configuration</a><ul class="internal"><li><a class="tocitem" href="#Document-Metadata-1"><span>Document Metadata</span></a></li><li><a class="tocitem" href="#Configuration-Options-1"><span>Configuration Options</span></a></li><li><a class="tocitem" href="#Format-Specific-Options-1"><span>Format Specific Options</span></a></li></ul></li><li><a class="tocitem" href="../notebooks/">Working with Jupyter notebooks</a></li><li><a class="tocitem" href="../function_index/">Function index</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"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Header Configuration</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Header Configuration</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/JunoLab/Weave.jl/blob/master/doc/src/header.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="Header-Configuration-1"><a class="docs-heading-anchor" href="#Header-Configuration-1">Header Configuration</a><a class="docs-heading-anchor-permalink" href="#Header-Configuration-1" title="Permalink"></a></h1><p>When <code>weave</code>ing a markdown document, you use YAML header to provide additional metadata and confi
|
||
|
title : Header Example
|
||
|
author : Shuhei Kadowaki
|
||
|
date: 16th May 2020
|
||
|
---</code></pre><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>You can also have other metadata, but they won't appear in the resulting HTML and PDF. If you weave to Julia markdown to GitHub/Hugo markdown, all the metadata will be preserved.</p></div></div><h3 id="Dynamic-Metadata-1"><a class="docs-heading-anchor" href="#Dynamic-Metadata-1">Dynamic Metadata</a><a class="docs-heading-anchor-permalink" href="#Dynamic-Metadata-1" title="Permalink"></a></h3><p>The metadata can be given "dynamically"; if you have <a href="../usage/#inline-code-1">inline code</a> within YAML header, they will be evaluated <em>after</em> evaluating all the chunks and replaced with the results.</p><p>The example document below will set <code>date</code> metadata dynamically. Note that <code>Date</code> is available since the chunk is evaluated first.</p><pre><code class="language-md"> ---
|
||
|
title : Header Example
|
||
|
author : Shuhei Kadowaki
|
||
|
date: `j Date(now())`
|
||
|
---
|
||
|
|
||
|
```julia; echo = false
|
||
|
using Datas
|
||
|
```</code></pre><h2 id="Configuration-Options-1"><a class="docs-heading-anchor" href="#Configuration-Options-1">Configuration Options</a><a class="docs-heading-anchor-permalink" href="#Configuration-Options-1" title="Permalink"></a></h2><p>Each of keyword arguments of <a href="../usage/#Weave.weave"><code>weave</code></a> can be set in the YAML header under <code>options</code> field. You can also set <a href="@ref">Chunks Options</a> there that will be applied globally.</p><p>The example below sets <code>out_path</code> and <code>doctype</code> options and overwrites <code>term</code> and <code>wrap</code> chunk options:</p><pre><code class="language-yaml">---
|
||
|
title : Header Example
|
||
|
author : Shuhei Kadowaki
|
||
|
date: 16th May 2020
|
||
|
weave_options:
|
||
|
out_path: relative/path/to/this/document
|
||
|
doctype: github
|
||
|
term: true
|
||
|
wrap: false
|
||
|
---</code></pre><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><ul><li>configurations specified within the YAML header have higher precedence than those specified via <code>weave</code> keyword arguments</li><li>chunk options specified within each chunk have higher precedence than the global global chunk options specified within the YAML header</li></ul></div></div><div class="admonition is-warning"><header class="admonition-header">Warning</header><div class="admonition-body"><p>As opposed to metadata, <em>most</em> of those configuration options can't be given dynamically (i.e. can't be via inline code), since they are needed for evaluation of chunks themselves. But some configuration options that are needed "formatting" document can still be given dynamically:</p><ul><li><code>template</code></li><li><code>css</code></li><li><code>highlight_theme</code></li><li><code>pandoc_options</code></li><li><code>latex_cmd</code></li><li><code>keep_unicode</code></li></ul><p>See also: <a href="../usage/#Weave.weave"><code>weave</code></a></p></div></div><h2 id="Format-Specific-Options-1"><a class="docs-heading-anchor" href="#Format-Specific-Options-1">Format Specific Options</a><a class="docs-heading-anchor-permalink" href="#Format-Specific-Options-1" title="Permalink"></a></h2><p>The header configurations can be format specific. Here is how to set different <code>out_path</code> for <code>md2html</code> and <code>md2pdf</code> and set <code>fig_ext</code> globally:</p><pre><code class="language-yaml">---
|
||
|
weave_options:
|
||
|
md2html:
|
||
|
out_path : html
|
||
|
md2pdf:
|
||
|
out_path : pdf
|
||
|
fig_ext : .png
|
||
|
---</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../chunk_options/">« Chunk Options</a><a class="docs-footer-nextpage" href="../notebooks/">Working with Jupyter notebooks »</a></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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> on <span class="colophon-date" title="Friday 5 June 2020 10:15">Friday 5 June 2020</span>. Using Julia version 1.4.2.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
|