Release v0.4.1

gh-pages
Matti Pastell 2017-03-15 17:19:42 +02:00
parent 41c0e00d09
commit 6c707df58d
80 changed files with 5606 additions and 0 deletions

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -0,0 +1,18 @@
div.wy-menu-vertical ul.current li.toctree-l3 a {
font-weight: bold;
}
a.documenter-source {
float: right;
}
.documenter-methodtable pre {
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
padding: 0px;
}
.documenter-methodtable pre.documenter-inline {
display: inline;
}

BIN
v0.4.1/assets/fonts/icon.eot Executable file

Binary file not shown.

22
v0.4.1/assets/fonts/icon.svg Executable file
View File

@ -0,0 +1,22 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="icon" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
<glyph unicode="&#xe600;" glyph-name="search" d="M661.333 341.334h-33.92l-11.733 11.733c41.813 48.427 66.987 111.36 66.987 180.267 0 153.173-124.16 277.333-277.333 277.333s-277.333-124.16-277.333-277.333 124.16-277.333 277.333-277.333c68.907 0 131.84 25.173 180.267 66.773l11.733-11.733v-33.707l213.333-212.907 63.573 63.573-212.907 213.333zM405.333 341.334c-106.027 0-192 85.973-192 192s85.973 192 192 192 192-85.973 192-192-85.973-192-192-192z" />
<glyph unicode="&#xe601;" glyph-name="arrow-back" d="M853.333 469.334h-519.253l238.293 238.293-60.373 60.373-341.333-341.333 341.333-341.333 60.373 60.373-238.293 238.293h519.253v85.333z" />
<glyph unicode="&#xe602;" glyph-name="chevron-right" d="M426.667 682.667l-60.373-60.373 195.627-195.627-195.627-195.627 60.373-60.373 256 256z" />
<glyph unicode="&#xe603;" glyph-name="close" d="M810.667 664.96l-60.373 60.373-238.293-238.293-238.293 238.293-60.373-60.373 238.293-238.293-238.293-238.293 60.373-60.373 238.293 238.293 238.293-238.293 60.373 60.373-238.293 238.293z" />
<glyph unicode="&#xe604;" glyph-name="menu" d="M128 170.667h768v85.333h-768v-85.333zM128 384h768v85.333h-768v-85.333zM128 682.667v-85.333h768v85.333h-768z" />
<glyph unicode="&#xe605;" glyph-name="arrow-forward" d="M512 768l-60.373-60.373 238.293-238.293h-519.253v-85.333h519.253l-238.293-238.293 60.373-60.373 341.333 341.333z" />
<glyph unicode="&#xe606;" glyph-name="twitter" d="M1024 744.249c-37.676-16.708-78.164-28.002-120.66-33.080 43.372 26 76.686 67.17 92.372 116.23-40.596-24.078-85.556-41.56-133.41-50.98-38.32 40.83-92.922 66.34-153.346 66.34-116.022 0-210.088-94.058-210.088-210.078 0-16.466 1.858-32.5 5.44-47.878-174.6 8.764-329.402 92.4-433.018 219.506-18.084-31.028-28.446-67.116-28.446-105.618 0-72.888 37.088-137.192 93.46-174.866-34.438 1.092-66.832 10.542-95.154 26.278-0.020-0.876-0.020-1.756-0.020-2.642 0-101.788 72.418-186.696 168.522-206-17.626-4.8-36.188-7.372-55.348-7.372-13.538 0-26.698 1.32-39.528 3.772 26.736-83.46 104.32-144.206 196.252-145.896-71.9-56.35-162.486-89.934-260.916-89.934-16.958 0-33.68 0.994-50.116 2.94 92.972-59.61 203.402-94.394 322.042-94.394 386.422 0 597.736 320.124 597.736 597.744 0 9.108-0.206 18.168-0.61 27.18 41.056 29.62 76.672 66.62 104.836 108.748z" />
<glyph unicode="&#xe607;" glyph-name="github" d="M512.008 926.025c-282.738 0-512.008-229.218-512.008-511.998 0-226.214 146.704-418.132 350.136-485.836 25.586-4.738 34.992 11.11 34.992 24.632 0 12.204-0.48 52.542-0.696 95.324-142.448-30.976-172.504 60.41-172.504 60.41-23.282 59.176-56.848 74.916-56.848 74.916-46.452 31.778 3.51 31.124 3.51 31.124 51.4-3.61 78.476-52.766 78.476-52.766 45.672-78.27 119.776-55.64 149.004-42.558 4.588 33.086 17.852 55.68 32.506 68.464-113.73 12.942-233.276 56.85-233.276 253.032 0 55.898 20.004 101.574 52.76 137.428-5.316 12.9-22.854 64.972 4.952 135.5 0 0 43.006 13.752 140.84-52.49 40.836 11.348 84.636 17.036 128.154 17.234 43.502-0.198 87.336-5.886 128.256-17.234 97.734 66.244 140.656 52.49 140.656 52.49 27.872-70.528 10.35-122.6 5.036-135.5 32.82-35.856 52.694-81.532 52.694-137.428 0-196.654-119.778-239.95-233.79-252.624 18.364-15.89 34.724-47.046 34.724-94.812 0-68.508-0.596-123.644-0.596-140.508 0-13.628 9.222-29.594 35.172-24.566 203.322 67.776 349.842 259.626 349.842 485.768 0 282.78-229.234 511.998-511.992 511.998z" />
<glyph unicode="&#xe608;" glyph-name="download" d="M810.667 554.667h-170.667v256h-256v-256h-170.667l298.667-298.667 298.667 298.667zM213.333 170.667v-85.333h597.333v85.333h-597.333z" />
<glyph unicode="&#xe609;" glyph-name="star" d="M512 201.814l263.68-159.147-69.973 299.947 232.96 201.813-306.773 26.027-119.893 282.88-119.893-282.88-306.773-26.027 232.96-201.813-69.973-299.947z" />
<glyph unicode="&#xe610;" glyph-name="warning" d="M554 340.667v172h-84v-172h84zM554 170.667v86h-84v-86h84zM42 42.667l470 810 470-810h-940z" />
<glyph unicode="&#xe611;" glyph-name="hint" d="M614 682.667h240v-426h-300l-16 84h-240v-298h-84v726h384z" />
</font></defs></svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
v0.4.1/assets/fonts/icon.ttf Executable file

Binary file not shown.

BIN
v0.4.1/assets/fonts/icon.woff Executable file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,25 @@
MathJax.Hub.Config({
"tex2jax": {
inlineMath: [['$','$'], ['\\(','\\)']],
processEscapes: true
}
});
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
jax: [
"input/TeX",
"output/HTML-CSS",
"output/NativeMML"
],
extensions: [
"MathMenu.js",
"MathZoom.js",
"TeX/AMSmath.js",
"TeX/AMSsymbols.js",
"TeX/autobold.js",
"TeX/autoload-all.js"
]
});
MathJax.Hub.Config({
TeX: { equationNumbers: { autoNumber: "AMS" } }
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,452 @@
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="no-js ie6"><![endif]-->
<!--[if IE 7 ]><html class="no-js ie7"><![endif]-->
<!--[if IE 8 ]><html class="no-js ie8"><![endif]-->
<!--[if IE 9 ]><html class="no-js ie9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1">
<title>Chunk options - Weave.jl</title>
<meta name="author" content="Matti Pastell">
<meta property="og:url" content="None">
<meta property="og:title" content="Weave.jl">
<meta property="og:image" content="None/../">
<meta name="apple-mobile-web-app-title" content="Weave.jl">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="shortcut icon" type="image/x-icon" href="../assets/images/favicon-e565ddfa3b.ico">
<link rel="icon" type="image/x-icon" href="../assets/images/favicon-e565ddfa3b.ico">
<style>
@font-face {
font-family: 'Icon';
src: url('../assets/fonts/icon.eot?52m981');
src: url('../assets/fonts/icon.eot?#iefix52m981')
format('embedded-opentype'),
url('../assets/fonts/icon.woff?52m981')
format('woff'),
url('../assets/fonts/icon.ttf?52m981')
format('truetype'),
url('../assets/fonts/icon.svg?52m981#icon')
format('svg');
font-weight: normal;
font-style: normal;
}
</style>
<link rel="stylesheet" href="../assets/stylesheets/application-a422ff04cc.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:400,700|Ubuntu+Mono">
<style>
body, input {
font-family: 'Ubuntu', Helvetica, Arial, sans-serif;
}
pre, code {
font-family: 'Ubuntu Mono', 'Courier New', 'Courier', monospace;
}
</style>
<link rel="stylesheet" href="../assets/Documenter.css">
<script src="../assets/javascripts/modernizr-4ab42b99fd.js"></script>
</head>
<body class=" ">
<div class="backdrop">
<div class="backdrop-paper"></div>
</div>
<input class="toggle" type="checkbox" id="toggle-drawer">
<input class="toggle" type="checkbox" id="toggle-search">
<label class="toggle-button overlay" for="toggle-drawer"></label>
<header class="header">
<nav aria-label="Header">
<div class="bar default">
<div class="button button-menu" role="button" aria-label="Menu">
<label class="toggle-button icon icon-menu" for="toggle-drawer">
<span></span>
</label>
</div>
<div class="stretch">
<div class="title">
<span class="path">
</span>
Chunk options
</div>
</div>
<div class="button button-twitter" role="button" aria-label="Twitter">
<a href="https://twitter.com/mpastell" title="@mpastell on Twitter" target="_blank" class="toggle-button icon icon-twitter"></a>
</div>
<div class="button button-search" role="button" aria-label="Search">
<label class="toggle-button icon icon-search" title="Search" for="toggle-search"></label>
</div>
</div>
<div class="bar search">
<div class="button button-close" role="button" aria-label="Close">
<label class="toggle-button icon icon-back" for="toggle-search"></label>
</div>
<div class="stretch">
<div class="field">
<input class="query" type="text" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck>
</div>
</div>
<div class="button button-reset" role="button" aria-label="Search">
<button class="toggle-button icon icon-close" id="reset-search"></button>
</div>
</div>
</nav>
</header>
<main class="main">
<div class="drawer">
<nav aria-label="Navigation">
<a href="https://github.com/mpastell/Weave.jl" class="project">
<div class="banner">
<div class="name">
<strong>
Weave.jl
<span class="version">
v0.4.0
</span>
</strong>
<br>
mpastell/Weave.jl
</div>
</div>
</a>
<div class="scrollable">
<div class="wrapper">
<ul class="repo">
<li class="repo-download">
<a href="https://github.com/mpastell/Weave.jl/archive/v0.4.0.zip" target="_blank" title="Download" data-action="download">
<i class="icon icon-download"></i> Download
</a>
</li>
<li class="repo-stars">
<a href="https://github.com/mpastell/Weave.jl/stargazers" target="_blank" title="Stargazers" data-action="star">
<i class="icon icon-star"></i> Stars
<span class="count">&ndash;</span>
</a>
</li>
</ul>
<hr>
<div class="toc">
<ul>
<li>
<a class="" title="Home" href="..">
Home
</a>
</li>
<li>
<a class="" title="Getting started" href="../getting_started/">
Getting started
</a>
</li>
<li>
<a class="" title="Using Weave" href="../usage/">
Using Weave
</a>
</li>
<li>
<a class="" title="Publishing scripts" href="../publish/">
Publishing scripts
</a>
</li>
<li>
<a class="current" title="Chunk options" href="./">
Chunk options
</a>
<ul>
<li class="anchor">
<a title="Options for code" href="#options-for-code">
Options for code
</a>
</li>
<li class="anchor">
<a title="Options for figures" href="#options-for-figures">
Options for figures
</a>
</li>
<li class="anchor">
<a title="Set default chunk options" href="#set-default-chunk-options">
Set default chunk options
</a>
</li>
</ul>
</li>
<li>
<a class="" title="Working with Jupyter notebooks" href="../notebooks/">
Working with Jupyter notebooks
</a>
</li>
<li>
<a class="" title="Function index" href="../function_index/">
Function index
</a>
</li>
</ul>
<hr>
<span class="section">The author</span>
<ul>
<li>
<a href="https://twitter.com/mpastell" target="_blank" title="@mpastell on Twitter">
@mpastell on Twitter
</a>
</li>
</ul>
</div>
</div>
</div>
</nav>
</div>
<article class="article">
<div class="wrapper">
<p><a id='Chunk-options-1'></a></p>
<h1 id="chunk-options">Chunk options</h1>
<p>I've mostly followed <a href="http://yihui.name/knitr/options">Knitr</a>'s naming for chunk options, but not all options are implemented.</p>
<p>Options are separated using ";" and need to be valid Julia expressions. Example: A code chunk that saves and displays a 12 cm wide image and hides the source code:</p>
<div class="code"><pre><span></span><span class="o">&lt;&lt;</span><span class="n">fig_width</span><span class="o">=</span><span class="mi">5</span><span class="p">;</span> <span class="n">echo</span><span class="o">=</span><span class="kc">false</span> <span class="o">&gt;&gt;=</span>
<span class="k">using</span> <span class="n">Gadfly</span>
<span class="n">x</span> <span class="o">=</span> <span class="n">linspace</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="nb">π</span><span class="p">,</span> <span class="mi">200</span><span class="p">)</span>
<span class="n">plot</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">sin</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">Geom</span><span class="o">.</span><span class="n">line</span><span class="p">)</span>
<span class="err">@</span>
</pre></div>
<p>Weave currently supports the following chunk options with the following defaults:</p>
<p><a id='Options-for-code-1'></a></p>
<h2 id="options-for-code">Options for code</h2>
<ul>
<li><code>echo = true</code>. Echo the code in the output document. If <code>false</code> the source code will be hidden.</li>
<li><code>results = "markup"</code>. The output format of the printed results. "markup" for literal block, "hidden" for hidden results or anything else for raw output (I tend to use tex for Latex and rst for rest. Raw output is useful if you want to e.g. create tables from code chunks.</li>
<li><code>eval = true</code>. Evaluate the code chunk. If false the chunk wont be executed.</li>
<li><code>term=false</code>. If true the output emulates a REPL session. Otherwise only stdout and figures will be included in output.</li>
<li><code>label</code>. Chunk label, will be used for figure labels in Latex as fig:label</li>
<li><code>wrap = true</code>. Wrap long lines from output.</li>
<li><code>line_width = 75</code>. Line width for wrapped lines.</li>
<li><code>cache = false</code>. Cache results, depends on <code>cache</code> parameter on <code>weave</code> function.</li>
<li><code>hold = false</code>. Hold all results until the end of the chunk.</li>
<li><code>tangle = true</code>. Set tangle to false to exclude chunk from tangled code.</li>
</ul>
<p><a id='Options-for-figures-1'></a></p>
<h2 id="options-for-figures">Options for figures</h2>
<ul>
<li><code>fig_width</code>. Figure width defined in markup, default depends on the output format.</li>
<li><code>out_width</code>. Width of saved figure.</li>
<li><code>out_height</code>. Height of saved figure.</li>
<li><code>dpi</code>=96. Resolution of saved figures.</li>
<li><code>fig_cap</code>. Figure caption.</li>
<li><code>label</code>. Chunk label, will be used for figure labels in Latex as fig:label</li>
<li><code>fig_ext</code>. File extension (format) of saved figures.</li>
<li><code>fig_pos="htpb"</code>. Figure position in Latex.</li>
<li><code>fig_env="figure"</code>. Figure environment in Latex.</li>
</ul>
<p><a id='Set-default-chunk-options-1'></a></p>
<h2 id="set-default-chunk-options">Set default chunk options</h2>
<p>You can set or alter the default chunk options for a document either before running weave or inside the weaved document. You can e.g. use a hidden chunk in the beginning of the source document to set the options:</p>
<div class="code"><pre><span></span><span class="o">&lt;&lt;</span><span class="n">echo</span> <span class="o">=</span> <span class="kc">false</span><span class="o">&gt;&gt;=</span>
<span class="k">import</span> <span class="n">Weave</span>
<span class="n">Weave</span><span class="o">.</span><span class="n">set_chunk_defaults</span><span class="p">(</span><span class="kt">Dict</span><span class="p">{</span><span class="kt">Symbol</span><span class="p">,</span> <span class="kt">Any</span><span class="p">}(</span>
<span class="o">:</span><span class="n">out_width</span> <span class="o">=&gt;</span> <span class="s">&quot;</span><span class="se">\\</span><span class="s">0.5linewidth&quot;</span><span class="p">,</span>
<span class="o">:</span><span class="n">results</span> <span class="o">=&gt;</span> <span class="s">&quot;tex&quot;</span>
<span class="p">))</span>
<span class="err">@</span>
</pre></div>
<div class="code"><pre><span></span>set_chunk_defaults(opts)
get_chunk_defaults()
restore_chunk_defaults()
</pre></div>
<aside class="copyright" role="note">
Matti Pastell 2016 &ndash;
Documentation built with
<a href="http://www.mkdocs.org" target="_blank">MkDocs</a>
using the
<a href="http://squidfunk.github.io/mkdocs-material/" target="_blank">
Material
</a>
theme.
</aside>
<footer class="footer">
<nav class="pagination" aria-label="Footer">
<div class="previous">
<a href="../publish/" title="Publishing scripts">
<span class="direction">
Previous
</span>
<div class="page">
<div class="button button-previous" role="button" aria-label="Previous">
<i class="icon icon-back"></i>
</div>
<div class="stretch">
<div class="title">
Publishing scripts
</div>
</div>
</div>
</a>
</div>
<div class="next">
<a href="../notebooks/" title="Working with Jupyter notebooks">
<span class="direction">
Next
</span>
<div class="page">
<div class="stretch">
<div class="title">
Working with Jupyter notebooks
</div>
</div>
<div class="button button-next" role="button" aria-label="Next">
<i class="icon icon-forward"></i>
</div>
</div>
</a>
</div>
</nav>
</footer>
</div>
</article>
<div class="results" role="status" aria-live="polite">
<div class="scrollable">
<div class="wrapper">
<div class="meta"></div>
<div class="list"></div>
</div>
</div>
</div>
</main>
<script>
var base_url = '..';
var repo_id = 'mpastell/Weave.jl';
</script>
<script src="../assets/javascripts/application-997097ee0c.js"></script>
<script src="../assets/mathjaxhelper.js"></script>
<script>
(function(i,s,o,g,r,a,m){
i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||
[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;
m.parentNode.insertBefore(a,m)
})(window, document,
'script', 'https://www.google-analytics.com/analytics.js', 'ga');
/* General initialization */
ga('create', 'UA-6474352-10', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
/* Track outbound links */
var buttons = document.querySelectorAll('a');
Array.prototype.map.call(buttons, function(item) {
if (item.host != document.location.host) {
item.addEventListener('click', function() {
var action = item.getAttribute('data-action') || 'follow';
ga('send', 'event', 'outbound', action, item.href);
});
}
});
/* Register handler to log search on blur */
var query = document.querySelector('.query');
query.addEventListener('blur', function() {
if (this.value) {
var path = document.location.pathname;
ga('send', 'pageview', path + '?q=' + this.value);
}
});
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,83 @@
#' ---
#' title : FIR filter design with Julia
#' author : Matti Pastell
#' date : 21th April 2016
#' ---
#' # Introduction
#' This an example of a julia script that can be published using
#' [Weave](http://mpastell.github.io/Weave.jl/latest/usage/).
#' The script can be executed normally using Julia
#' or published to HTML or pdf with Weave.
#' Text is written in markdown in lines starting with "`#'` " and code
#' is executed and results are included in the published document.
#' Notice that you don't need to define chunk options, but you can using
#' `#+`. just before code e.g. `#+ term=True, caption='Fancy plots.'`.
#' If you're viewing the published version have a look at the
#' [source](FIR_design.jl) to see the markup.
#' # FIR Filter Design
#' We'll implement lowpass, highpass and ' bandpass FIR filters. If
#' you want to read more about DSP I highly recommend [The Scientist
#' and Engineer's Guide to Digital Signal
#' Processing](http://www.dspguide.com/) which is freely available
#' online.
#' ## Calculating frequency response
#' DSP.jl package doesn't (yet) have a method to calculate the
#' the frequency response of a FIR filter so we define it:
using Gadfly, DSP
function FIRfreqz(b::Array, w = linspace(0, π, 1024))
n = length(w)
h = Array{Complex64}(n)
sw = 0
for i = 1:n
for j = 1:length(b)
sw += b[j]*exp(-im*w[i])^-j
end
h[i] = sw
sw = 0
end
return h
end
#' ## Design Lowpass FIR filter
#' Designing a lowpass FIR filter is very simple to do with DSP.jl, all you
#' need to do is to define the window length, cut off frequency and the
#' window. We will define a lowpass filter with cut off frequency at 5Hz for a signal
#' sampled at 20 Hz.
#' We will use the Hamming window, which is defined as:
#' $w(n) = \alpha - \beta\cos\frac{2\pi n}{N-1}$, where $\alpha=0.54$ and $\beta=0.46$
fs = 20
f = digitalfilter(Lowpass(5, fs = fs), FIRWindow(hamming(61)))
w = linspace(0, pi, 1024)
h = FIRfreqz(f, w)
#' ## Plot the frequency and impulse response
#' The next code chunk is executed in term mode, see the [script](FIR_design.jl) for syntax.
#+ term=true
h_db = log10(abs(h));
ws = w/pi*(fs/2)
#+
plot(y = h_db, x = ws, Geom.line,
Guide.xlabel("Frequency (Hz)"), Guide.ylabel("Magnitude (db)"))
#' And again with default options
h_phase = unwrap(-atan2(imag(h),real(h)))
plot(y = h_phase, x = ws, Geom.line,
Guide.xlabel("Frequency (Hz)"), Guide.ylabel("Phase (radians)"))

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,74 @@
---
title : Intro to Weave.jl with Gadfly
author : Matti Pastell
date : 13th December 2016
---
This a sample [Julia](http://julialang.org/) markdown document that can
be executed using [Weave.jl](https://github.com/mpastell/Weave.jl).
The code is delimited from docs using markdown fenced code blocks
markup which can be seen looking at the source document
[gadfly_md_sample.jmd](gadfly_md_sample.jmd)
in the examples directory of the package. The source document can be executed
and the results with Gadfly plots are captured in the resulting file.
You can create markdown output or pdf (with xelatex) and HTML directly using
the weave command as follows:
```{julia; eval=false}
using Weave
#Markdown
weave(Pkg.dir("Weave","examples","gadfly_md_sample.jmd"), informat="markdown",
out_path = :pwd, doctype = "pandoc")
#HTML
weave(Pkg.dir("Weave","examples","gadfly_md_sample.jmd"), informat="markdown",
out_path = :pwd, doctype = "md2html")
#pdf
weave(Pkg.dir("Weave","examples","gadfly_md_sample.jmd"), informat="markdown",
out_path = :pwd, doctype = "md2pdf")
```
*The markdown variant used for html and pdf output is Julia markdown.*
The documents will be written to the Julia working directory when you
use the `out_path = :pwd`.
## Capturing code
The basic code chunk will be run with default options and the code and
output will be captured.
```julia
using Gadfly
x = linspace(0, 2*pi)
println(x)
plot(x = x, y = sin(x))
```
You can also control the way the results are captured, plot size etc.
using chunk options. Here is an example of a chunk that behaves like a repl.
```{julia;term=true}
x = 1:10
d = Dict("Weave" => "testing")
y = [2, 4 ,8]
```
You can also for instance hide the code and show only the figure, add a
caption to the figure and make it wider as follows (you can only see the
syntax from the source document):
```{julia;echo=false; fig_cap="A random walk."; label="random"; fig_width=7; fig_height=4}
plot(y = cumsum(randn(1000, 1)), Geom.line)
```
## Whats next
Read the documentation:
- stable: [http://mpastell.github.io/Weave.jl/stable/](http://mpastell.github.io/Weave.jl/stable/)
- latest: [http://mpastell.github.io/Weave.jl/latest/](http://mpastell.github.io/Weave.jl/latest/)
See other examples in the [Github repo](https://github.com/mpastell/Weave.jl/tree/master/examples)

Binary file not shown.

View File

@ -0,0 +1,100 @@
This a sample [Julia](http://julialang.org/) markdown document that can
be executed using [Weave.jl](https://github.com/mpastell/Weave.jl).
The code is delimited from docs using markdown fenced code blocks
markup which can be seen looking at the source document
[gadfly_md_sample.jmd](gadfly_md_sample.jmd)
in the examples directory of the package. The source document can be executed
and the results with Gadfly plots are captured in the resulting file.
You can create markdown output or pdf (with xelatex) and HTML directly using
the weave command as follows:
~~~~{.julia}
using Weave
#Markdown
weave(Pkg.dir("Weave","examples","gadfly_md_sample.jmd"), informat="markdown",
out_path = :pwd, doctype = "pandoc")
#HTML
weave(Pkg.dir("Weave","examples","gadfly_md_sample.jmd"), informat="markdown",
out_path = :pwd, doctype = "md2html")
#pdf
weave(Pkg.dir("Weave","examples","gadfly_md_sample.jmd"), informat="markdown",
out_path = :pwd, doctype = "md2pdf")
~~~~~~~~~~~~~
*The markdown variant used for html and pdf output is Julia markdown.*
The documents will be written to the Julia working directory when you
use the `out_path = :pwd`.
## Capturing code
The basic code chunk will be run with default options and the code and
output will be captured.
~~~~{.julia}
using Gadfly
x = linspace(0, 2*pi)
println(x)
~~~~~~~~~~~~~
~~~~
linspace(0.0,6.283185307179586,50)
~~~~
~~~~{.julia}
plot(x = x, y = sin(x))
~~~~~~~~~~~~~
![](figures/gadfly_md_sample_2_1.png)\
You can also control the way the results are captured, plot size etc.
using chunk options. Here is an example of a chunk that behaves like a repl.
~~~~{.julia}
julia> x = 1:10
1:10
julia> d = Dict("Weave" => "testing")
Dict{String,String} with 1 entry:
"Weave" => "testing"
julia> y = [2, 4 ,8]
3-element Array{Int64,1}:
2
4
8
~~~~~~~~~~~~~
You can also for instance hide the code and show only the figure, add a
caption to the figure and make it wider as follows (you can only see the
syntax from the source document):
![A random walk.](figures/gadfly_md_sample_random_1.png)
## Whats next
Read the documentation:
- stable: [http://mpastell.github.io/Weave.jl/stable/](http://mpastell.github.io/Weave.jl/stable/)
- latest: [http://mpastell.github.io/Weave.jl/latest/](http://mpastell.github.io/Weave.jl/latest/)
See other examples in the [Github repo](https://github.com/mpastell/Weave.jl/tree/master/examples)

View File

@ -0,0 +1,367 @@
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="no-js ie6"><![endif]-->
<!--[if IE 7 ]><html class="no-js ie7"><![endif]-->
<!--[if IE 8 ]><html class="no-js ie8"><![endif]-->
<!--[if IE 9 ]><html class="no-js ie9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1">
<title>Function index - Weave.jl</title>
<meta name="author" content="Matti Pastell">
<meta property="og:url" content="None">
<meta property="og:title" content="Weave.jl">
<meta property="og:image" content="None/../">
<meta name="apple-mobile-web-app-title" content="Weave.jl">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="shortcut icon" type="image/x-icon" href="../assets/images/favicon-e565ddfa3b.ico">
<link rel="icon" type="image/x-icon" href="../assets/images/favicon-e565ddfa3b.ico">
<style>
@font-face {
font-family: 'Icon';
src: url('../assets/fonts/icon.eot?52m981');
src: url('../assets/fonts/icon.eot?#iefix52m981')
format('embedded-opentype'),
url('../assets/fonts/icon.woff?52m981')
format('woff'),
url('../assets/fonts/icon.ttf?52m981')
format('truetype'),
url('../assets/fonts/icon.svg?52m981#icon')
format('svg');
font-weight: normal;
font-style: normal;
}
</style>
<link rel="stylesheet" href="../assets/stylesheets/application-a422ff04cc.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:400,700|Ubuntu+Mono">
<style>
body, input {
font-family: 'Ubuntu', Helvetica, Arial, sans-serif;
}
pre, code {
font-family: 'Ubuntu Mono', 'Courier New', 'Courier', monospace;
}
</style>
<link rel="stylesheet" href="../assets/Documenter.css">
<script src="../assets/javascripts/modernizr-4ab42b99fd.js"></script>
</head>
<body class=" ">
<div class="backdrop">
<div class="backdrop-paper"></div>
</div>
<input class="toggle" type="checkbox" id="toggle-drawer">
<input class="toggle" type="checkbox" id="toggle-search">
<label class="toggle-button overlay" for="toggle-drawer"></label>
<header class="header">
<nav aria-label="Header">
<div class="bar default">
<div class="button button-menu" role="button" aria-label="Menu">
<label class="toggle-button icon icon-menu" for="toggle-drawer">
<span></span>
</label>
</div>
<div class="stretch">
<div class="title">
<span class="path">
</span>
Function index
</div>
</div>
<div class="button button-twitter" role="button" aria-label="Twitter">
<a href="https://twitter.com/mpastell" title="@mpastell on Twitter" target="_blank" class="toggle-button icon icon-twitter"></a>
</div>
<div class="button button-search" role="button" aria-label="Search">
<label class="toggle-button icon icon-search" title="Search" for="toggle-search"></label>
</div>
</div>
<div class="bar search">
<div class="button button-close" role="button" aria-label="Close">
<label class="toggle-button icon icon-back" for="toggle-search"></label>
</div>
<div class="stretch">
<div class="field">
<input class="query" type="text" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck>
</div>
</div>
<div class="button button-reset" role="button" aria-label="Search">
<button class="toggle-button icon icon-close" id="reset-search"></button>
</div>
</div>
</nav>
</header>
<main class="main">
<div class="drawer">
<nav aria-label="Navigation">
<a href="https://github.com/mpastell/Weave.jl" class="project">
<div class="banner">
<div class="name">
<strong>
Weave.jl
<span class="version">
v0.4.0
</span>
</strong>
<br>
mpastell/Weave.jl
</div>
</div>
</a>
<div class="scrollable">
<div class="wrapper">
<ul class="repo">
<li class="repo-download">
<a href="https://github.com/mpastell/Weave.jl/archive/v0.4.0.zip" target="_blank" title="Download" data-action="download">
<i class="icon icon-download"></i> Download
</a>
</li>
<li class="repo-stars">
<a href="https://github.com/mpastell/Weave.jl/stargazers" target="_blank" title="Stargazers" data-action="star">
<i class="icon icon-star"></i> Stars
<span class="count">&ndash;</span>
</a>
</li>
</ul>
<hr>
<div class="toc">
<ul>
<li>
<a class="" title="Home" href="..">
Home
</a>
</li>
<li>
<a class="" title="Getting started" href="../getting_started/">
Getting started
</a>
</li>
<li>
<a class="" title="Using Weave" href="../usage/">
Using Weave
</a>
</li>
<li>
<a class="" title="Publishing scripts" href="../publish/">
Publishing scripts
</a>
</li>
<li>
<a class="" title="Chunk options" href="../chunk_options/">
Chunk options
</a>
</li>
<li>
<a class="" title="Working with Jupyter notebooks" href="../notebooks/">
Working with Jupyter notebooks
</a>
</li>
<li>
<a class="current" title="Function index" href="./">
Function index
</a>
</li>
</ul>
<hr>
<span class="section">The author</span>
<ul>
<li>
<a href="https://twitter.com/mpastell" target="_blank" title="@mpastell on Twitter">
@mpastell on Twitter
</a>
</li>
</ul>
</div>
</div>
</div>
</nav>
</div>
<article class="article">
<div class="wrapper">
<p><a id='Function-index-1'></a></p>
<h1 id="function-index">Function index</h1>
<ul>
<li><a href="../notebooks/#Weave.convert_doc-Tuple{String,String}"><code>Weave.convert_doc</code></a></li>
<li><a href="../chunk_options/#Weave.get_chunk_defaults-Tuple{}"><code>Weave.get_chunk_defaults</code></a></li>
<li><a href="../usage/#Weave.list_out_formats-Tuple{}"><code>Weave.list_out_formats</code></a></li>
<li><a href="../chunk_options/#Weave.restore_chunk_defaults-Tuple{}"><code>Weave.restore_chunk_defaults</code></a></li>
<li><a href="../usage/#Weave.tangle-Tuple{Any}"><code>Weave.tangle</code></a></li>
<li><a href="../usage/#Weave.weave-Tuple{Any}"><code>Weave.weave</code></a></li>
</ul>
<aside class="copyright" role="note">
Matti Pastell 2016 &ndash;
Documentation built with
<a href="http://www.mkdocs.org" target="_blank">MkDocs</a>
using the
<a href="http://squidfunk.github.io/mkdocs-material/" target="_blank">
Material
</a>
theme.
</aside>
<footer class="footer">
<nav class="pagination" aria-label="Footer">
<div class="previous">
<a href="../notebooks/" title="Working with Jupyter notebooks">
<span class="direction">
Previous
</span>
<div class="page">
<div class="button button-previous" role="button" aria-label="Previous">
<i class="icon icon-back"></i>
</div>
<div class="stretch">
<div class="title">
Working with Jupyter notebooks
</div>
</div>
</div>
</a>
</div>
<div class="next">
</div>
</nav>
</footer>
</div>
</article>
<div class="results" role="status" aria-live="polite">
<div class="scrollable">
<div class="wrapper">
<div class="meta"></div>
<div class="list"></div>
</div>
</div>
</div>
</main>
<script>
var base_url = '..';
var repo_id = 'mpastell/Weave.jl';
</script>
<script src="../assets/javascripts/application-997097ee0c.js"></script>
<script src="../assets/mathjaxhelper.js"></script>
<script>
(function(i,s,o,g,r,a,m){
i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||
[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;
m.parentNode.insertBefore(a,m)
})(window, document,
'script', 'https://www.google-analytics.com/analytics.js', 'ga');
/* General initialization */
ga('create', 'UA-6474352-10', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
/* Track outbound links */
var buttons = document.querySelectorAll('a');
Array.prototype.map.call(buttons, function(item) {
if (item.host != document.location.host) {
item.addEventListener('click', function() {
var action = item.getAttribute('data-action') || 'follow';
ga('send', 'event', 'outbound', action, item.href);
});
}
});
/* Register handler to log search on blur */
var query = document.querySelector('.query');
query.addEventListener('blur', function() {
if (this.value) {
var path = document.location.pathname;
ga('send', 'pageview', path + '?q=' + this.value);
}
});
</script>
</body>
</html>

View File

@ -0,0 +1,395 @@
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="no-js ie6"><![endif]-->
<!--[if IE 7 ]><html class="no-js ie7"><![endif]-->
<!--[if IE 8 ]><html class="no-js ie8"><![endif]-->
<!--[if IE 9 ]><html class="no-js ie9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1">
<title>Getting started - Weave.jl</title>
<meta name="author" content="Matti Pastell">
<meta property="og:url" content="None">
<meta property="og:title" content="Weave.jl">
<meta property="og:image" content="None/../">
<meta name="apple-mobile-web-app-title" content="Weave.jl">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="shortcut icon" type="image/x-icon" href="../assets/images/favicon-e565ddfa3b.ico">
<link rel="icon" type="image/x-icon" href="../assets/images/favicon-e565ddfa3b.ico">
<style>
@font-face {
font-family: 'Icon';
src: url('../assets/fonts/icon.eot?52m981');
src: url('../assets/fonts/icon.eot?#iefix52m981')
format('embedded-opentype'),
url('../assets/fonts/icon.woff?52m981')
format('woff'),
url('../assets/fonts/icon.ttf?52m981')
format('truetype'),
url('../assets/fonts/icon.svg?52m981#icon')
format('svg');
font-weight: normal;
font-style: normal;
}
</style>
<link rel="stylesheet" href="../assets/stylesheets/application-a422ff04cc.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:400,700|Ubuntu+Mono">
<style>
body, input {
font-family: 'Ubuntu', Helvetica, Arial, sans-serif;
}
pre, code {
font-family: 'Ubuntu Mono', 'Courier New', 'Courier', monospace;
}
</style>
<link rel="stylesheet" href="../assets/Documenter.css">
<script src="../assets/javascripts/modernizr-4ab42b99fd.js"></script>
</head>
<body class=" ">
<div class="backdrop">
<div class="backdrop-paper"></div>
</div>
<input class="toggle" type="checkbox" id="toggle-drawer">
<input class="toggle" type="checkbox" id="toggle-search">
<label class="toggle-button overlay" for="toggle-drawer"></label>
<header class="header">
<nav aria-label="Header">
<div class="bar default">
<div class="button button-menu" role="button" aria-label="Menu">
<label class="toggle-button icon icon-menu" for="toggle-drawer">
<span></span>
</label>
</div>
<div class="stretch">
<div class="title">
<span class="path">
</span>
Getting started
</div>
</div>
<div class="button button-twitter" role="button" aria-label="Twitter">
<a href="https://twitter.com/mpastell" title="@mpastell on Twitter" target="_blank" class="toggle-button icon icon-twitter"></a>
</div>
<div class="button button-search" role="button" aria-label="Search">
<label class="toggle-button icon icon-search" title="Search" for="toggle-search"></label>
</div>
</div>
<div class="bar search">
<div class="button button-close" role="button" aria-label="Close">
<label class="toggle-button icon icon-back" for="toggle-search"></label>
</div>
<div class="stretch">
<div class="field">
<input class="query" type="text" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck>
</div>
</div>
<div class="button button-reset" role="button" aria-label="Search">
<button class="toggle-button icon icon-close" id="reset-search"></button>
</div>
</div>
</nav>
</header>
<main class="main">
<div class="drawer">
<nav aria-label="Navigation">
<a href="https://github.com/mpastell/Weave.jl" class="project">
<div class="banner">
<div class="name">
<strong>
Weave.jl
<span class="version">
v0.4.0
</span>
</strong>
<br>
mpastell/Weave.jl
</div>
</div>
</a>
<div class="scrollable">
<div class="wrapper">
<ul class="repo">
<li class="repo-download">
<a href="https://github.com/mpastell/Weave.jl/archive/v0.4.0.zip" target="_blank" title="Download" data-action="download">
<i class="icon icon-download"></i> Download
</a>
</li>
<li class="repo-stars">
<a href="https://github.com/mpastell/Weave.jl/stargazers" target="_blank" title="Stargazers" data-action="star">
<i class="icon icon-star"></i> Stars
<span class="count">&ndash;</span>
</a>
</li>
</ul>
<hr>
<div class="toc">
<ul>
<li>
<a class="" title="Home" href="..">
Home
</a>
</li>
<li>
<a class="current" title="Getting started" href="./">
Getting started
</a>
</li>
<li>
<a class="" title="Using Weave" href="../usage/">
Using Weave
</a>
</li>
<li>
<a class="" title="Publishing scripts" href="../publish/">
Publishing scripts
</a>
</li>
<li>
<a class="" title="Chunk options" href="../chunk_options/">
Chunk options
</a>
</li>
<li>
<a class="" title="Working with Jupyter notebooks" href="../notebooks/">
Working with Jupyter notebooks
</a>
</li>
<li>
<a class="" title="Function index" href="../function_index/">
Function index
</a>
</li>
</ul>
<hr>
<span class="section">The author</span>
<ul>
<li>
<a href="https://twitter.com/mpastell" target="_blank" title="@mpastell on Twitter">
@mpastell on Twitter
</a>
</li>
</ul>
</div>
</div>
</div>
</nav>
</div>
<article class="article">
<div class="wrapper">
<p><a id='Getting-started-1'></a></p>
<h1 id="getting-started">Getting started</h1>
<p>The best way to get started using Weave.jl is to look at the example input and output documents. Examples for different formats are included in the packages <code>examples</code> directory.</p>
<p>First have a look at source document using markdown code chunks and Gadfly for figures: <a href="../examples/gadfly_md_sample.jmd">gadfly_md_sample.jmd</a> and then see the output in different formats:</p>
<ul>
<li>Pandoc markdown: <a href="../examples/gadfly_md_sample.txt">gadfly_md_sample.md</a></li>
<li>HTML: <a href="../examples/gadfly_md_sample.html">gadfly_md_sample.html</a></li>
<li>pdf: <a href="../examples/gadfly_md_sample.pdf">gadfly_md_sample.pdf</a></li>
</ul>
<p><em>Producing pdf output requires that you have pdflatex installed.</em></p>
<p>You can Weave the files to your working directory using:</p>
<div class="code"><pre><span></span><span class="k">using</span> <span class="n">Weave</span>
<span class="c">#Markdown</span>
<span class="n">weave</span><span class="p">(</span><span class="n">Pkg</span><span class="o">.</span><span class="n">dir</span><span class="p">(</span><span class="s">&quot;Weave&quot;</span><span class="p">,</span><span class="s">&quot;examples&quot;</span><span class="p">,</span><span class="s">&quot;gadfly_md_sample.jmd&quot;</span><span class="p">),</span> <span class="n">out_path</span> <span class="o">=</span> <span class="o">:</span><span class="n">pwd</span><span class="p">,</span>
<span class="n">doctype</span> <span class="o">=</span> <span class="s">&quot;pandoc&quot;</span><span class="p">)</span>
<span class="c">#HTML</span>
<span class="n">weave</span><span class="p">(</span><span class="n">Pkg</span><span class="o">.</span><span class="n">dir</span><span class="p">(</span><span class="s">&quot;Weave&quot;</span><span class="p">,</span><span class="s">&quot;examples&quot;</span><span class="p">,</span><span class="s">&quot;gadfly_md_sample.jmd&quot;</span><span class="p">),</span> <span class="n">out_path</span> <span class="o">=</span> <span class="o">:</span><span class="n">pwd</span><span class="p">,</span>
<span class="n">doctype</span> <span class="o">=</span> <span class="s">&quot;md2html&quot;</span><span class="p">)</span>
<span class="c">#pdf</span>
<span class="n">weave</span><span class="p">(</span><span class="n">Pkg</span><span class="o">.</span><span class="n">dir</span><span class="p">(</span><span class="s">&quot;Weave&quot;</span><span class="p">,</span><span class="s">&quot;examples&quot;</span><span class="p">,</span><span class="s">&quot;gadfly_md_sample.jmd&quot;</span><span class="p">),</span> <span class="n">out_path</span> <span class="o">=</span> <span class="o">:</span><span class="n">pwd</span><span class="p">,</span>
<span class="n">doctype</span> <span class="o">=</span> <span class="s">&quot;md2pdf&quot;</span><span class="p">)</span>
</pre></div>
<aside class="copyright" role="note">
Matti Pastell 2016 &ndash;
Documentation built with
<a href="http://www.mkdocs.org" target="_blank">MkDocs</a>
using the
<a href="http://squidfunk.github.io/mkdocs-material/" target="_blank">
Material
</a>
theme.
</aside>
<footer class="footer">
<nav class="pagination" aria-label="Footer">
<div class="previous">
<a href=".." title="Home">
<span class="direction">
Previous
</span>
<div class="page">
<div class="button button-previous" role="button" aria-label="Previous">
<i class="icon icon-back"></i>
</div>
<div class="stretch">
<div class="title">
Home
</div>
</div>
</div>
</a>
</div>
<div class="next">
<a href="../usage/" title="Using Weave">
<span class="direction">
Next
</span>
<div class="page">
<div class="stretch">
<div class="title">
Using Weave
</div>
</div>
<div class="button button-next" role="button" aria-label="Next">
<i class="icon icon-forward"></i>
</div>
</div>
</a>
</div>
</nav>
</footer>
</div>
</article>
<div class="results" role="status" aria-live="polite">
<div class="scrollable">
<div class="wrapper">
<div class="meta"></div>
<div class="list"></div>
</div>
</div>
</div>
</main>
<script>
var base_url = '..';
var repo_id = 'mpastell/Weave.jl';
</script>
<script src="../assets/javascripts/application-997097ee0c.js"></script>
<script src="../assets/mathjaxhelper.js"></script>
<script>
(function(i,s,o,g,r,a,m){
i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||
[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;
m.parentNode.insertBefore(a,m)
})(window, document,
'script', 'https://www.google-analytics.com/analytics.js', 'ga');
/* General initialization */
ga('create', 'UA-6474352-10', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
/* Track outbound links */
var buttons = document.querySelectorAll('a');
Array.prototype.map.call(buttons, function(item) {
if (item.host != document.location.host) {
item.addEventListener('click', function() {
var action = item.getAttribute('data-action') || 'follow';
ga('send', 'event', 'outbound', action, item.href);
});
}
});
/* Register handler to log search on blur */
var query = document.querySelector('.query');
query.addEventListener('blur', function() {
if (this.value) {
var path = document.location.pathname;
ga('send', 'pageview', path + '?q=' + this.value);
}
});
</script>
</body>
</html>

415
v0.4.1/index.html Normal file
View File

@ -0,0 +1,415 @@
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="no-js ie6"><![endif]-->
<!--[if IE 7 ]><html class="no-js ie7"><![endif]-->
<!--[if IE 8 ]><html class="no-js ie8"><![endif]-->
<!--[if IE 9 ]><html class="no-js ie9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1">
<title>Weave.jl</title>
<meta name="author" content="Matti Pastell">
<meta property="og:url" content="None">
<meta property="og:title" content="Weave.jl">
<meta property="og:image" content="None/./">
<meta name="apple-mobile-web-app-title" content="Weave.jl">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="shortcut icon" type="image/x-icon" href="./assets/images/favicon-e565ddfa3b.ico">
<link rel="icon" type="image/x-icon" href="./assets/images/favicon-e565ddfa3b.ico">
<style>
@font-face {
font-family: 'Icon';
src: url('./assets/fonts/icon.eot?52m981');
src: url('./assets/fonts/icon.eot?#iefix52m981')
format('embedded-opentype'),
url('./assets/fonts/icon.woff?52m981')
format('woff'),
url('./assets/fonts/icon.ttf?52m981')
format('truetype'),
url('./assets/fonts/icon.svg?52m981#icon')
format('svg');
font-weight: normal;
font-style: normal;
}
</style>
<link rel="stylesheet" href="./assets/stylesheets/application-a422ff04cc.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:400,700|Ubuntu+Mono">
<style>
body, input {
font-family: 'Ubuntu', Helvetica, Arial, sans-serif;
}
pre, code {
font-family: 'Ubuntu Mono', 'Courier New', 'Courier', monospace;
}
</style>
<link rel="stylesheet" href="./assets/Documenter.css">
<script src="./assets/javascripts/modernizr-4ab42b99fd.js"></script>
</head>
<body class=" ">
<div class="backdrop">
<div class="backdrop-paper"></div>
</div>
<input class="toggle" type="checkbox" id="toggle-drawer">
<input class="toggle" type="checkbox" id="toggle-search">
<label class="toggle-button overlay" for="toggle-drawer"></label>
<header class="header">
<nav aria-label="Header">
<div class="bar default">
<div class="button button-menu" role="button" aria-label="Menu">
<label class="toggle-button icon icon-menu" for="toggle-drawer">
<span></span>
</label>
</div>
<div class="stretch">
<div class="title">
<span class="path">
</span>
Weave.jl
</div>
</div>
<div class="button button-twitter" role="button" aria-label="Twitter">
<a href="https://twitter.com/mpastell" title="@mpastell on Twitter" target="_blank" class="toggle-button icon icon-twitter"></a>
</div>
<div class="button button-search" role="button" aria-label="Search">
<label class="toggle-button icon icon-search" title="Search" for="toggle-search"></label>
</div>
</div>
<div class="bar search">
<div class="button button-close" role="button" aria-label="Close">
<label class="toggle-button icon icon-back" for="toggle-search"></label>
</div>
<div class="stretch">
<div class="field">
<input class="query" type="text" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck>
</div>
</div>
<div class="button button-reset" role="button" aria-label="Search">
<button class="toggle-button icon icon-close" id="reset-search"></button>
</div>
</div>
</nav>
</header>
<main class="main">
<div class="drawer">
<nav aria-label="Navigation">
<a href="https://github.com/mpastell/Weave.jl" class="project">
<div class="banner">
<div class="name">
<strong>
Weave.jl
<span class="version">
v0.4.0
</span>
</strong>
<br>
mpastell/Weave.jl
</div>
</div>
</a>
<div class="scrollable">
<div class="wrapper">
<ul class="repo">
<li class="repo-download">
<a href="https://github.com/mpastell/Weave.jl/archive/v0.4.0.zip" target="_blank" title="Download" data-action="download">
<i class="icon icon-download"></i> Download
</a>
</li>
<li class="repo-stars">
<a href="https://github.com/mpastell/Weave.jl/stargazers" target="_blank" title="Stargazers" data-action="star">
<i class="icon icon-star"></i> Stars
<span class="count">&ndash;</span>
</a>
</li>
</ul>
<hr>
<div class="toc">
<ul>
<li>
<a class="current" title="Home" href=".">
Home
</a>
<ul>
<li class="anchor">
<a title="Contents" href="#contents">
Contents
</a>
</li>
</ul>
</li>
<li>
<a class="" title="Getting started" href="getting_started/">
Getting started
</a>
</li>
<li>
<a class="" title="Using Weave" href="usage/">
Using Weave
</a>
</li>
<li>
<a class="" title="Publishing scripts" href="publish/">
Publishing scripts
</a>
</li>
<li>
<a class="" title="Chunk options" href="chunk_options/">
Chunk options
</a>
</li>
<li>
<a class="" title="Working with Jupyter notebooks" href="notebooks/">
Working with Jupyter notebooks
</a>
</li>
<li>
<a class="" title="Function index" href="function_index/">
Function index
</a>
</li>
</ul>
<hr>
<span class="section">The author</span>
<ul>
<li>
<a href="https://twitter.com/mpastell" target="_blank" title="@mpastell on Twitter">
@mpastell on Twitter
</a>
</li>
</ul>
</div>
</div>
</div>
</nav>
</div>
<article class="article">
<div class="wrapper">
<p><a id='Weave.jl-Scientific-Reports-Using-Julia-1'></a></p>
<h1 id="weavejl-scientific-reports-using-julia">Weave.jl - Scientific Reports Using Julia</h1>
<p>This is the documentation of <a href="http://github.com/mpastell/weave.jl">Weave.jl</a>. Weave is a scientific report generator/literate programming tool for Julia. It resembles <a href="http://mpastell.com/pweave">Pweave</a>, Knitr, rmarkdown and Sweave.</p>
<p><strong>Current features</strong></p>
<ul>
<li>Noweb, markdown or script syntax for input documents.</li>
<li>Execute code as terminal or "script" chunks.</li>
<li>Capture Plots, Gadfly, PyPlot and Winston figures.</li>
<li>Supports LaTex, Pandoc, Github markdown, MultiMarkdown, Asciidoc and reStructuredText output</li>
<li>Publish markdown directly to html and pdf using julia or Pandoc markdown.</li>
<li>Simple caching of results</li>
<li>Convert to and from IJulia notebooks</li>
</ul>
<p><img alt="Weave code and output" src="http://mpastell.com/images/weave_demo.png" /></p>
<p><a id='Contents-1'></a></p>
<h2 id="contents">Contents</h2>
<ul>
<li><a href="getting_started/#Getting-started-1">Getting started</a></li>
<li><a href="usage/#Using-Weave-1">Using Weave</a><ul>
<li><a href="usage/#Weave-1">Weave</a></li>
<li><a href="usage/#Weave-from-shell-1">Weave from shell</a></li>
<li><a href="usage/#Tangle-1">Tangle</a></li>
<li><a href="usage/#Supported-formats-1">Supported formats</a></li>
<li><a href="usage/#Document-syntax-1">Document syntax</a></li>
<li><a href="usage/#Noweb-format-1">Noweb format</a></li>
<li><a href="usage/#Markdown-format-1">Markdown format</a></li>
<li><a href="usage/#Script-format-1">Script format</a></li>
<li><a href="usage/#Inline-code-1">Inline code</a></li>
<li><a href="usage/#Passing-arguments-to-documents-1">Passing arguments to documents</a></li>
</ul>
</li>
<li><a href="publish/#Publishing-to-html-and-pdf-1">Publishing to html and pdf</a><ul>
<li><a href="publish/#Templates-1">Templates</a></li>
</ul>
</li>
<li><a href="chunk_options/#Chunk-options-1">Chunk options</a><ul>
<li><a href="chunk_options/#Options-for-code-1">Options for code</a></li>
<li><a href="chunk_options/#Options-for-figures-1">Options for figures</a></li>
<li><a href="chunk_options/#Set-default-chunk-options-1">Set default chunk options</a></li>
</ul>
</li>
<li><a href="notebooks/#Working-with-Jupyter-notebooks-1">Working with Jupyter notebooks</a><ul>
<li><a href="notebooks/#Weaving-1">Weaving</a></li>
<li><a href="notebooks/#Converting-between-formats-1">Converting between formats</a></li>
</ul>
</li>
<li><a href="function_index/#Function-index-1">Function index</a></li>
</ul>
<aside class="copyright" role="note">
Matti Pastell 2016 &ndash;
Documentation built with
<a href="http://www.mkdocs.org" target="_blank">MkDocs</a>
using the
<a href="http://squidfunk.github.io/mkdocs-material/" target="_blank">
Material
</a>
theme.
</aside>
<footer class="footer">
<nav class="pagination" aria-label="Footer">
<div class="previous">
</div>
<div class="next">
<a href="getting_started/" title="Getting started">
<span class="direction">
Next
</span>
<div class="page">
<div class="stretch">
<div class="title">
Getting started
</div>
</div>
<div class="button button-next" role="button" aria-label="Next">
<i class="icon icon-forward"></i>
</div>
</div>
</a>
</div>
</nav>
</footer>
</div>
</article>
<div class="results" role="status" aria-live="polite">
<div class="scrollable">
<div class="wrapper">
<div class="meta"></div>
<div class="list"></div>
</div>
</div>
</div>
</main>
<script>
var base_url = '.';
var repo_id = 'mpastell/Weave.jl';
</script>
<script src="./assets/javascripts/application-997097ee0c.js"></script>
<script src="./assets/mathjaxhelper.js"></script>
<script>
(function(i,s,o,g,r,a,m){
i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||
[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;
m.parentNode.insertBefore(a,m)
})(window, document,
'script', 'https://www.google-analytics.com/analytics.js', 'ga');
/* General initialization */
ga('create', 'UA-6474352-10', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
/* Track outbound links */
var buttons = document.querySelectorAll('a');
Array.prototype.map.call(buttons, function(item) {
if (item.host != document.location.host) {
item.addEventListener('click', function() {
var action = item.getAttribute('data-action') || 'follow';
ga('send', 'event', 'outbound', action, item.href);
});
}
});
/* Register handler to log search on blur */
var query = document.querySelector('.query');
query.addEventListener('blur', function() {
if (this.value) {
var path = document.location.pathname;
ga('send', 'pageview', path + '?q=' + this.value);
}
});
</script>
</body>
</html>

7
v0.4.1/mkdocs/js/lunr.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1
v0.4.1/mkdocs/js/mustache.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,36 @@
/*
RequireJS 2.1.16 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved.
Available via the MIT or new BSD license.
see: http://github.com/jrburke/requirejs for details
*/
var requirejs,require,define;
(function(ba){function G(b){return"[object Function]"===K.call(b)}function H(b){return"[object Array]"===K.call(b)}function v(b,c){if(b){var d;for(d=0;d<b.length&&(!b[d]||!c(b[d],d,b));d+=1);}}function T(b,c){if(b){var d;for(d=b.length-1;-1<d&&(!b[d]||!c(b[d],d,b));d-=1);}}function t(b,c){return fa.call(b,c)}function m(b,c){return t(b,c)&&b[c]}function B(b,c){for(var d in b)if(t(b,d)&&c(b[d],d))break}function U(b,c,d,e){c&&B(c,function(c,g){if(d||!t(b,g))e&&"object"===typeof c&&c&&!H(c)&&!G(c)&&!(c instanceof
RegExp)?(b[g]||(b[g]={}),U(b[g],c,d,e)):b[g]=c});return b}function u(b,c){return function(){return c.apply(b,arguments)}}function ca(b){throw b;}function da(b){if(!b)return b;var c=ba;v(b.split("."),function(b){c=c[b]});return c}function C(b,c,d,e){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requireType=b;c.requireModules=e;d&&(c.originalError=d);return c}function ga(b){function c(a,k,b){var f,l,c,d,e,g,i,p,k=k&&k.split("/"),h=j.map,n=h&&h["*"];if(a){a=a.split("/");l=a.length-1;j.nodeIdCompat&&
Q.test(a[l])&&(a[l]=a[l].replace(Q,""));"."===a[0].charAt(0)&&k&&(l=k.slice(0,k.length-1),a=l.concat(a));l=a;for(c=0;c<l.length;c++)if(d=l[c],"."===d)l.splice(c,1),c-=1;else if(".."===d&&!(0===c||1==c&&".."===l[2]||".."===l[c-1])&&0<c)l.splice(c-1,2),c-=2;a=a.join("/")}if(b&&h&&(k||n)){l=a.split("/");c=l.length;a:for(;0<c;c-=1){e=l.slice(0,c).join("/");if(k)for(d=k.length;0<d;d-=1)if(b=m(h,k.slice(0,d).join("/")))if(b=m(b,e)){f=b;g=c;break a}!i&&(n&&m(n,e))&&(i=m(n,e),p=c)}!f&&i&&(f=i,g=p);f&&(l.splice(0,
g,f),a=l.join("/"))}return(f=m(j.pkgs,a))?f:a}function d(a){z&&v(document.getElementsByTagName("script"),function(k){if(k.getAttribute("data-requiremodule")===a&&k.getAttribute("data-requirecontext")===i.contextName)return k.parentNode.removeChild(k),!0})}function e(a){var k=m(j.paths,a);if(k&&H(k)&&1<k.length)return k.shift(),i.require.undef(a),i.makeRequire(null,{skipMap:!0})([a]),!0}function n(a){var k,c=a?a.indexOf("!"):-1;-1<c&&(k=a.substring(0,c),a=a.substring(c+1,a.length));return[k,a]}function p(a,
k,b,f){var l,d,e=null,g=k?k.name:null,j=a,p=!0,h="";a||(p=!1,a="_@r"+(K+=1));a=n(a);e=a[0];a=a[1];e&&(e=c(e,g,f),d=m(r,e));a&&(e?h=d&&d.normalize?d.normalize(a,function(a){return c(a,g,f)}):-1===a.indexOf("!")?c(a,g,f):a:(h=c(a,g,f),a=n(h),e=a[0],h=a[1],b=!0,l=i.nameToUrl(h)));b=e&&!d&&!b?"_unnormalized"+(O+=1):"";return{prefix:e,name:h,parentMap:k,unnormalized:!!b,url:l,originalName:j,isDefine:p,id:(e?e+"!"+h:h)+b}}function s(a){var k=a.id,b=m(h,k);b||(b=h[k]=new i.Module(a));return b}function q(a,
k,b){var f=a.id,c=m(h,f);if(t(r,f)&&(!c||c.defineEmitComplete))"defined"===k&&b(r[f]);else if(c=s(a),c.error&&"error"===k)b(c.error);else c.on(k,b)}function w(a,b){var c=a.requireModules,f=!1;if(b)b(a);else if(v(c,function(b){if(b=m(h,b))b.error=a,b.events.error&&(f=!0,b.emit("error",a))}),!f)g.onError(a)}function x(){R.length&&(ha.apply(A,[A.length,0].concat(R)),R=[])}function y(a){delete h[a];delete V[a]}function F(a,b,c){var f=a.map.id;a.error?a.emit("error",a.error):(b[f]=!0,v(a.depMaps,function(f,
d){var e=f.id,g=m(h,e);g&&(!a.depMatched[d]&&!c[e])&&(m(b,e)?(a.defineDep(d,r[e]),a.check()):F(g,b,c))}),c[f]=!0)}function D(){var a,b,c=(a=1E3*j.waitSeconds)&&i.startTime+a<(new Date).getTime(),f=[],l=[],g=!1,h=!0;if(!W){W=!0;B(V,function(a){var i=a.map,j=i.id;if(a.enabled&&(i.isDefine||l.push(a),!a.error))if(!a.inited&&c)e(j)?g=b=!0:(f.push(j),d(j));else if(!a.inited&&(a.fetched&&i.isDefine)&&(g=!0,!i.prefix))return h=!1});if(c&&f.length)return a=C("timeout","Load timeout for modules: "+f,null,
f),a.contextName=i.contextName,w(a);h&&v(l,function(a){F(a,{},{})});if((!c||b)&&g)if((z||ea)&&!X)X=setTimeout(function(){X=0;D()},50);W=!1}}function E(a){t(r,a[0])||s(p(a[0],null,!0)).init(a[1],a[2])}function I(a){var a=a.currentTarget||a.srcElement,b=i.onScriptLoad;a.detachEvent&&!Y?a.detachEvent("onreadystatechange",b):a.removeEventListener("load",b,!1);b=i.onScriptError;(!a.detachEvent||Y)&&a.removeEventListener("error",b,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}function J(){var a;
for(x();A.length;){a=A.shift();if(null===a[0])return w(C("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));E(a)}}var W,Z,i,L,X,j={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},h={},V={},$={},A=[],r={},S={},aa={},K=1,O=1;L={require:function(a){return a.require?a.require:a.require=i.makeRequire(a.map)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports?r[a.map.id]=a.exports:a.exports=r[a.map.id]={}},module:function(a){return a.module?
a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){return m(j.config,a.map.id)||{}},exports:a.exports||(a.exports={})}}};Z=function(a){this.events=m($,a.id)||{};this.map=a;this.shim=m(j.shim,a.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};Z.prototype={init:function(a,b,c,f){f=f||{};if(!this.inited){this.factory=b;if(c)this.on("error",c);else this.events.error&&(c=u(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.errback=
c;this.inited=!0;this.ignore=f.ignore;f.enabled||this.enabled?this.enable():this.check()}},defineDep:function(a,b){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=b)},fetch:function(){if(!this.fetched){this.fetched=!0;i.startTime=(new Date).getTime();var a=this.map;if(this.shim)i.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],u(this,function(){return a.prefix?this.callPlugin():this.load()}));else return a.prefix?this.callPlugin():this.load()}},load:function(){var a=
this.map.url;S[a]||(S[a]=!0,i.load(this.map.id,a))},check:function(){if(this.enabled&&!this.enabling){var a,b,c=this.map.id;b=this.depExports;var f=this.exports,l=this.factory;if(this.inited)if(this.error)this.emit("error",this.error);else{if(!this.defining){this.defining=!0;if(1>this.depCount&&!this.defined){if(G(l)){if(this.events.error&&this.map.isDefine||g.onError!==ca)try{f=i.execCb(c,l,b,f)}catch(d){a=d}else f=i.execCb(c,l,b,f);this.map.isDefine&&void 0===f&&((b=this.module)?f=b.exports:this.usingExports&&
(f=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",w(this.error=a)}else f=l;this.exports=f;if(this.map.isDefine&&!this.ignore&&(r[c]=f,g.onResourceLoad))g.onResourceLoad(i,this.map,this.depMaps);y(c);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var a=
this.map,b=a.id,d=p(a.prefix);this.depMaps.push(d);q(d,"defined",u(this,function(f){var l,d;d=m(aa,this.map.id);var e=this.map.name,P=this.map.parentMap?this.map.parentMap.name:null,n=i.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(f.normalize&&(e=f.normalize(e,function(a){return c(a,P,!0)})||""),f=p(a.prefix+"!"+e,this.map.parentMap),q(f,"defined",u(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),d=m(h,f.id)){this.depMaps.push(f);
if(this.events.error)d.on("error",u(this,function(a){this.emit("error",a)}));d.enable()}}else d?(this.map.url=i.nameToUrl(d),this.load()):(l=u(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),l.error=u(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];B(h,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&y(a.map.id)});w(a)}),l.fromText=u(this,function(f,c){var d=a.name,e=p(d),P=M;c&&(f=c);P&&(M=!1);s(e);t(j.config,b)&&(j.config[d]=j.config[b]);try{g.exec(f)}catch(h){return w(C("fromtexteval",
"fromText eval for "+b+" failed: "+h,h,[b]))}P&&(M=!0);this.depMaps.push(e);i.completeLoad(d);n([d],l)}),f.load(a.name,n,l,j))}));i.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){V[this.map.id]=this;this.enabling=this.enabled=!0;v(this.depMaps,u(this,function(a,b){var c,f;if("string"===typeof a){a=p(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=m(L,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;q(a,"defined",u(this,function(a){this.defineDep(b,
a);this.check()}));this.errback?q(a,"error",u(this,this.errback)):this.events.error&&q(a,"error",u(this,function(a){this.emit("error",a)}))}c=a.id;f=h[c];!t(L,c)&&(f&&!f.enabled)&&i.enable(a,this)}));B(this.pluginMaps,u(this,function(a){var b=m(h,a.id);b&&!b.enabled&&i.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){v(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};i={config:j,contextName:b,
registry:h,defined:r,urlFetched:S,defQueue:A,Module:Z,makeModuleMap:p,nextTick:g.nextTick,onError:w,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=j.shim,c={paths:!0,bundles:!0,config:!0,map:!0};B(a,function(a,b){c[b]?(j[b]||(j[b]={}),U(j[b],a,!0,!0)):j[b]=a});a.bundles&&B(a.bundles,function(a,b){v(a,function(a){a!==b&&(aa[a]=b)})});a.shim&&(B(a.shim,function(a,c){H(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=i.makeShimExports(a);
b[c]=a}),j.shim=b);a.packages&&v(a.packages,function(a){var b,a="string"===typeof a?{name:a}:a;b=a.name;a.location&&(j.paths[b]=a.location);j.pkgs[b]=a.name+"/"+(a.main||"main").replace(ia,"").replace(Q,"")});B(h,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=p(b))});if(a.deps||a.callback)i.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ba,arguments));return b||a.exports&&da(a.exports)}},makeRequire:function(a,e){function j(c,d,m){var n,
q;e.enableBuildCallback&&(d&&G(d))&&(d.__requireJsBuild=!0);if("string"===typeof c){if(G(d))return w(C("requireargs","Invalid require call"),m);if(a&&t(L,c))return L[c](h[a.id]);if(g.get)return g.get(i,c,a,j);n=p(c,a,!1,!0);n=n.id;return!t(r,n)?w(C("notloaded",'Module name "'+n+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):r[n]}J();i.nextTick(function(){J();q=s(p(null,a));q.skipMap=e.skipMap;q.init(c,d,m,{enabled:!0});D()});return j}e=e||{};U(j,{isBrowser:z,toUrl:function(b){var d,
e=b.lastIndexOf("."),k=b.split("/")[0];if(-1!==e&&(!("."===k||".."===k)||1<e))d=b.substring(e,b.length),b=b.substring(0,e);return i.nameToUrl(c(b,a&&a.id,!0),d,!0)},defined:function(b){return t(r,p(b,a,!1,!0).id)},specified:function(b){b=p(b,a,!1,!0).id;return t(r,b)||t(h,b)}});a||(j.undef=function(b){x();var c=p(b,a,!0),e=m(h,b);d(b);delete r[b];delete S[c.url];delete $[b];T(A,function(a,c){a[0]===b&&A.splice(c,1)});e&&(e.events.defined&&($[b]=e.events),y(b))});return j},enable:function(a){m(h,a.id)&&
s(a).enable()},completeLoad:function(a){var b,c,d=m(j.shim,a)||{},g=d.exports;for(x();A.length;){c=A.shift();if(null===c[0]){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);E(c)}c=m(h,a);if(!b&&!t(r,a)&&c&&!c.inited){if(j.enforceDefine&&(!g||!da(g)))return e(a)?void 0:w(C("nodefine","No define call for "+a,null,[a]));E([a,d.deps||[],d.exportsFn])}D()},nameToUrl:function(a,b,c){var d,e,h;(d=m(j.pkgs,a))&&(a=d);if(d=m(aa,a))return i.nameToUrl(d,b,c);if(g.jsExtRegExp.test(a))d=a+(b||"");else{d=j.paths;
a=a.split("/");for(e=a.length;0<e;e-=1)if(h=a.slice(0,e).join("/"),h=m(d,h)){H(h)&&(h=h[0]);a.splice(0,e,h);break}d=a.join("/");d+=b||(/^data\:|\?/.test(d)||c?"":".js");d=("/"===d.charAt(0)||d.match(/^[\w\+\.\-]+:/)?"":j.baseUrl)+d}return j.urlArgs?d+((-1===d.indexOf("?")?"?":"&")+j.urlArgs):d},load:function(a,b){g.load(i,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if("load"===a.type||ja.test((a.currentTarget||a.srcElement).readyState))N=null,a=I(a),i.completeLoad(a.id)},
onScriptError:function(a){var b=I(a);if(!e(b.id))return w(C("scripterror","Script error for: "+b.id,a,[b.id]))}};i.require=i.makeRequire();return i}var g,x,y,D,I,E,N,J,s,O,ka=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,la=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,Q=/\.js$/,ia=/^\.\//;x=Object.prototype;var K=x.toString,fa=x.hasOwnProperty,ha=Array.prototype.splice,z=!!("undefined"!==typeof window&&"undefined"!==typeof navigator&&window.document),ea=!z&&"undefined"!==typeof importScripts,ja=
z&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,Y="undefined"!==typeof opera&&"[object Opera]"===opera.toString(),F={},q={},R=[],M=!1;if("undefined"===typeof define){if("undefined"!==typeof requirejs){if(G(requirejs))return;q=requirejs;requirejs=void 0}"undefined"!==typeof require&&!G(require)&&(q=require,require=void 0);g=requirejs=function(b,c,d,e){var n,p="_";!H(b)&&"string"!==typeof b&&(n=b,H(c)?(b=c,c=d,d=e):b=[]);n&&n.context&&(p=n.context);(e=m(F,p))||(e=F[p]=g.s.newContext(p));
n&&e.configure(n);return e.require(b,c,d)};g.config=function(b){return g(b)};g.nextTick="undefined"!==typeof setTimeout?function(b){setTimeout(b,4)}:function(b){b()};require||(require=g);g.version="2.1.16";g.jsExtRegExp=/^\/|:|\?|\.js$/;g.isBrowser=z;x=g.s={contexts:F,newContext:ga};g({});v(["toUrl","undef","defined","specified"],function(b){g[b]=function(){var c=F._;return c.require[b].apply(c,arguments)}});if(z&&(y=x.head=document.getElementsByTagName("head")[0],D=document.getElementsByTagName("base")[0]))y=
x.head=D.parentNode;g.onError=ca;g.createNode=function(b){var c=b.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");c.type=b.scriptType||"text/javascript";c.charset="utf-8";c.async=!0;return c};g.load=function(b,c,d){var e=b&&b.config||{};if(z)return e=g.createNode(e,c,d),e.setAttribute("data-requirecontext",b.contextName),e.setAttribute("data-requiremodule",c),e.attachEvent&&!(e.attachEvent.toString&&0>e.attachEvent.toString().indexOf("[native code"))&&
!Y?(M=!0,e.attachEvent("onreadystatechange",b.onScriptLoad)):(e.addEventListener("load",b.onScriptLoad,!1),e.addEventListener("error",b.onScriptError,!1)),e.src=d,J=e,D?y.insertBefore(e,D):y.appendChild(e),J=null,e;if(ea)try{importScripts(d),b.completeLoad(c)}catch(m){b.onError(C("importscripts","importScripts failed for "+c+" at "+d,m,[c]))}};z&&!q.skipDataMain&&T(document.getElementsByTagName("script"),function(b){y||(y=b.parentNode);if(I=b.getAttribute("data-main"))return s=I,q.baseUrl||(E=s.split("/"),
s=E.pop(),O=E.length?E.join("/")+"/":"./",q.baseUrl=O),s=s.replace(Q,""),g.jsExtRegExp.test(s)&&(s=I),q.deps=q.deps?q.deps.concat(s):[s],!0});define=function(b,c,d){var e,g;"string"!==typeof b&&(d=c,c=b,b=null);H(c)||(d=c,c=null);!c&&G(d)&&(c=[],d.length&&(d.toString().replace(ka,"").replace(la,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));if(M){if(!(e=J))N&&"interactive"===N.readyState||T(document.getElementsByTagName("script"),function(b){if("interactive"===
b.readyState)return N=b}),e=N;e&&(b||(b=e.getAttribute("data-requiremodule")),g=F[e.getAttribute("data-requirecontext")])}(g?g.defQueue:R).push([b,c,d])};define.amd={jQuery:!0};g.exec=function(b){return eval(b)};g(q)}})(this);

View File

@ -0,0 +1,4 @@
<article>
<h3><a href="{{location}}">{{title}}</a></h3>
<p>{{summary}}</p>
</article>

View File

@ -0,0 +1,88 @@
require([
base_url + '/mkdocs/js/mustache.min.js',
base_url + '/mkdocs/js/lunr.min.js',
'text!search-results-template.mustache',
'text!../search_index.json',
], function (Mustache, lunr, results_template, data) {
"use strict";
function getSearchTerm()
{
var sPageURL = window.location.search.substring(1);
var sURLVariables = sPageURL.split('&');
for (var i = 0; i < sURLVariables.length; i++)
{
var sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] == 'q')
{
return decodeURIComponent(sParameterName[1].replace(/\+/g, '%20'));
}
}
}
var index = lunr(function () {
this.field('title', {boost: 10});
this.field('text');
this.ref('location');
});
data = JSON.parse(data);
var documents = {};
for (var i=0; i < data.docs.length; i++){
var doc = data.docs[i];
doc.location = base_url + doc.location;
index.add(doc);
documents[doc.location] = doc;
}
var search = function(){
var query = document.getElementById('mkdocs-search-query').value;
var search_results = document.getElementById("mkdocs-search-results");
while (search_results.firstChild) {
search_results.removeChild(search_results.firstChild);
}
if(query === ''){
return;
}
var results = index.search(query);
if (results.length > 0){
for (var i=0; i < results.length; i++){
var result = results[i];
doc = documents[result.ref];
doc.base_url = base_url;
doc.summary = doc.text.substring(0, 200);
var html = Mustache.to_html(results_template, doc);
search_results.insertAdjacentHTML('beforeend', html);
}
} else {
search_results.insertAdjacentHTML('beforeend', "<p>No results found</p>");
}
if(jQuery){
/*
* We currently only automatically hide bootstrap models. This
* requires jQuery to work.
*/
jQuery('#mkdocs_search_modal a').click(function(){
jQuery('#mkdocs_search_modal').modal('hide');
});
}
};
var search_input = document.getElementById('mkdocs-search-query');
var term = getSearchTerm();
if (term){
search_input.value = term;
search();
}
search_input.addEventListener("keyup", search);
});

390
v0.4.1/mkdocs/js/text.js Normal file
View File

@ -0,0 +1,390 @@
/**
* @license RequireJS text 2.0.12 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/requirejs/text for details
*/
/*jslint regexp: true */
/*global require, XMLHttpRequest, ActiveXObject,
define, window, process, Packages,
java, location, Components, FileUtils */
define(['module'], function (module) {
'use strict';
var text, fs, Cc, Ci, xpcIsWindows,
progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'],
xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,
bodyRegExp = /<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,
hasLocation = typeof location !== 'undefined' && location.href,
defaultProtocol = hasLocation && location.protocol && location.protocol.replace(/\:/, ''),
defaultHostName = hasLocation && location.hostname,
defaultPort = hasLocation && (location.port || undefined),
buildMap = {},
masterConfig = (module.config && module.config()) || {};
text = {
version: '2.0.12',
strip: function (content) {
//Strips <?xml ...?> declarations so that external SVG and XML
//documents can be added to a document without worry. Also, if the string
//is an HTML document, only the part inside the body tag is returned.
if (content) {
content = content.replace(xmlRegExp, "");
var matches = content.match(bodyRegExp);
if (matches) {
content = matches[1];
}
} else {
content = "";
}
return content;
},
jsEscape: function (content) {
return content.replace(/(['\\])/g, '\\$1')
.replace(/[\f]/g, "\\f")
.replace(/[\b]/g, "\\b")
.replace(/[\n]/g, "\\n")
.replace(/[\t]/g, "\\t")
.replace(/[\r]/g, "\\r")
.replace(/[\u2028]/g, "\\u2028")
.replace(/[\u2029]/g, "\\u2029");
},
createXhr: masterConfig.createXhr || function () {
//Would love to dump the ActiveX crap in here. Need IE 6 to die first.
var xhr, i, progId;
if (typeof XMLHttpRequest !== "undefined") {
return new XMLHttpRequest();
} else if (typeof ActiveXObject !== "undefined") {
for (i = 0; i < 3; i += 1) {
progId = progIds[i];
try {
xhr = new ActiveXObject(progId);
} catch (e) {}
if (xhr) {
progIds = [progId]; // so faster next time
break;
}
}
}
return xhr;
},
/**
* Parses a resource name into its component parts. Resource names
* look like: module/name.ext!strip, where the !strip part is
* optional.
* @param {String} name the resource name
* @returns {Object} with properties "moduleName", "ext" and "strip"
* where strip is a boolean.
*/
parseName: function (name) {
var modName, ext, temp,
strip = false,
index = name.indexOf("."),
isRelative = name.indexOf('./') === 0 ||
name.indexOf('../') === 0;
if (index !== -1 && (!isRelative || index > 1)) {
modName = name.substring(0, index);
ext = name.substring(index + 1, name.length);
} else {
modName = name;
}
temp = ext || modName;
index = temp.indexOf("!");
if (index !== -1) {
//Pull off the strip arg.
strip = temp.substring(index + 1) === "strip";
temp = temp.substring(0, index);
if (ext) {
ext = temp;
} else {
modName = temp;
}
}
return {
moduleName: modName,
ext: ext,
strip: strip
};
},
xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/,
/**
* Is an URL on another domain. Only works for browser use, returns
* false in non-browser environments. Only used to know if an
* optimized .js version of a text resource should be loaded
* instead.
* @param {String} url
* @returns Boolean
*/
useXhr: function (url, protocol, hostname, port) {
var uProtocol, uHostName, uPort,
match = text.xdRegExp.exec(url);
if (!match) {
return true;
}
uProtocol = match[2];
uHostName = match[3];
uHostName = uHostName.split(':');
uPort = uHostName[1];
uHostName = uHostName[0];
return (!uProtocol || uProtocol === protocol) &&
(!uHostName || uHostName.toLowerCase() === hostname.toLowerCase()) &&
((!uPort && !uHostName) || uPort === port);
},
finishLoad: function (name, strip, content, onLoad) {
content = strip ? text.strip(content) : content;
if (masterConfig.isBuild) {
buildMap[name] = content;
}
onLoad(content);
},
load: function (name, req, onLoad, config) {
//Name has format: some.module.filext!strip
//The strip part is optional.
//if strip is present, then that means only get the string contents
//inside a body tag in an HTML string. For XML/SVG content it means
//removing the <?xml ...?> declarations so the content can be inserted
//into the current doc without problems.
// Do not bother with the work if a build and text will
// not be inlined.
if (config && config.isBuild && !config.inlineText) {
onLoad();
return;
}
masterConfig.isBuild = config && config.isBuild;
var parsed = text.parseName(name),
nonStripName = parsed.moduleName +
(parsed.ext ? '.' + parsed.ext : ''),
url = req.toUrl(nonStripName),
useXhr = (masterConfig.useXhr) ||
text.useXhr;
// Do not load if it is an empty: url
if (url.indexOf('empty:') === 0) {
onLoad();
return;
}
//Load the text. Use XHR if possible and in a browser.
if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) {
text.get(url, function (content) {
text.finishLoad(name, parsed.strip, content, onLoad);
}, function (err) {
if (onLoad.error) {
onLoad.error(err);
}
});
} else {
//Need to fetch the resource across domains. Assume
//the resource has been optimized into a JS module. Fetch
//by the module name + extension, but do not include the
//!strip part to avoid file system issues.
req([nonStripName], function (content) {
text.finishLoad(parsed.moduleName + '.' + parsed.ext,
parsed.strip, content, onLoad);
});
}
},
write: function (pluginName, moduleName, write, config) {
if (buildMap.hasOwnProperty(moduleName)) {
var content = text.jsEscape(buildMap[moduleName]);
write.asModule(pluginName + "!" + moduleName,
"define(function () { return '" +
content +
"';});\n");
}
},
writeFile: function (pluginName, moduleName, req, write, config) {
var parsed = text.parseName(moduleName),
extPart = parsed.ext ? '.' + parsed.ext : '',
nonStripName = parsed.moduleName + extPart,
//Use a '.js' file name so that it indicates it is a
//script that can be loaded across domains.
fileName = req.toUrl(parsed.moduleName + extPart) + '.js';
//Leverage own load() method to load plugin value, but only
//write out values that do not have the strip argument,
//to avoid any potential issues with ! in file names.
text.load(nonStripName, req, function (value) {
//Use own write() method to construct full module value.
//But need to create shell that translates writeFile's
//write() to the right interface.
var textWrite = function (contents) {
return write(fileName, contents);
};
textWrite.asModule = function (moduleName, contents) {
return write.asModule(moduleName, fileName, contents);
};
text.write(pluginName, nonStripName, textWrite, config);
}, config);
}
};
if (masterConfig.env === 'node' || (!masterConfig.env &&
typeof process !== "undefined" &&
process.versions &&
!!process.versions.node &&
!process.versions['node-webkit'])) {
//Using special require.nodeRequire, something added by r.js.
fs = require.nodeRequire('fs');
text.get = function (url, callback, errback) {
try {
var file = fs.readFileSync(url, 'utf8');
//Remove BOM (Byte Mark Order) from utf8 files if it is there.
if (file.indexOf('\uFEFF') === 0) {
file = file.substring(1);
}
callback(file);
} catch (e) {
if (errback) {
errback(e);
}
}
};
} else if (masterConfig.env === 'xhr' || (!masterConfig.env &&
text.createXhr())) {
text.get = function (url, callback, errback, headers) {
var xhr = text.createXhr(), header;
xhr.open('GET', url, true);
//Allow plugins direct access to xhr headers
if (headers) {
for (header in headers) {
if (headers.hasOwnProperty(header)) {
xhr.setRequestHeader(header.toLowerCase(), headers[header]);
}
}
}
//Allow overrides specified in config
if (masterConfig.onXhr) {
masterConfig.onXhr(xhr, url);
}
xhr.onreadystatechange = function (evt) {
var status, err;
//Do not explicitly handle errors, those should be
//visible via console output in the browser.
if (xhr.readyState === 4) {
status = xhr.status || 0;
if (status > 399 && status < 600) {
//An http 4xx or 5xx error. Signal an error.
err = new Error(url + ' HTTP status: ' + status);
err.xhr = xhr;
if (errback) {
errback(err);
}
} else {
callback(xhr.responseText);
}
if (masterConfig.onXhrComplete) {
masterConfig.onXhrComplete(xhr, url);
}
}
};
xhr.send(null);
};
} else if (masterConfig.env === 'rhino' || (!masterConfig.env &&
typeof Packages !== 'undefined' && typeof java !== 'undefined')) {
//Why Java, why is this so awkward?
text.get = function (url, callback) {
var stringBuffer, line,
encoding = "utf-8",
file = new java.io.File(url),
lineSeparator = java.lang.System.getProperty("line.separator"),
input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)),
content = '';
try {
stringBuffer = new java.lang.StringBuffer();
line = input.readLine();
// Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324
// http://www.unicode.org/faq/utf_bom.html
// Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK:
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058
if (line && line.length() && line.charAt(0) === 0xfeff) {
// Eat the BOM, since we've already found the encoding on this file,
// and we plan to concatenating this buffer with others; the BOM should
// only appear at the top of a file.
line = line.substring(1);
}
if (line !== null) {
stringBuffer.append(line);
}
while ((line = input.readLine()) !== null) {
stringBuffer.append(lineSeparator);
stringBuffer.append(line);
}
//Make sure we return a JavaScript string and not a Java string.
content = String(stringBuffer.toString()); //String
} finally {
input.close();
}
callback(content);
};
} else if (masterConfig.env === 'xpconnect' || (!masterConfig.env &&
typeof Components !== 'undefined' && Components.classes &&
Components.interfaces)) {
//Avert your gaze!
Cc = Components.classes;
Ci = Components.interfaces;
Components.utils['import']('resource://gre/modules/FileUtils.jsm');
xpcIsWindows = ('@mozilla.org/windows-registry-key;1' in Cc);
text.get = function (url, callback) {
var inStream, convertStream, fileObj,
readData = {};
if (xpcIsWindows) {
url = url.replace(/\//g, '\\');
}
fileObj = new FileUtils.File(url);
//XPCOM, you so crazy
try {
inStream = Cc['@mozilla.org/network/file-input-stream;1']
.createInstance(Ci.nsIFileInputStream);
inStream.init(fileObj, 1, 0, false);
convertStream = Cc['@mozilla.org/intl/converter-input-stream;1']
.createInstance(Ci.nsIConverterInputStream);
convertStream.init(inStream, "utf-8", inStream.available(),
Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
convertStream.readString(inStream.available(), readData);
convertStream.close();
inStream.close();
callback(readData.value);
} catch (e) {
throw new Error((fileObj && fileObj.path || '') + ': ' + e);
}
};
}
return text;
});

File diff suppressed because one or more lines are too long

421
v0.4.1/notebooks/index.html Normal file
View File

@ -0,0 +1,421 @@
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="no-js ie6"><![endif]-->
<!--[if IE 7 ]><html class="no-js ie7"><![endif]-->
<!--[if IE 8 ]><html class="no-js ie8"><![endif]-->
<!--[if IE 9 ]><html class="no-js ie9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1">
<title>Working with Jupyter notebooks - Weave.jl</title>
<meta name="author" content="Matti Pastell">
<meta property="og:url" content="None">
<meta property="og:title" content="Weave.jl">
<meta property="og:image" content="None/../">
<meta name="apple-mobile-web-app-title" content="Weave.jl">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="shortcut icon" type="image/x-icon" href="../assets/images/favicon-e565ddfa3b.ico">
<link rel="icon" type="image/x-icon" href="../assets/images/favicon-e565ddfa3b.ico">
<style>
@font-face {
font-family: 'Icon';
src: url('../assets/fonts/icon.eot?52m981');
src: url('../assets/fonts/icon.eot?#iefix52m981')
format('embedded-opentype'),
url('../assets/fonts/icon.woff?52m981')
format('woff'),
url('../assets/fonts/icon.ttf?52m981')
format('truetype'),
url('../assets/fonts/icon.svg?52m981#icon')
format('svg');
font-weight: normal;
font-style: normal;
}
</style>
<link rel="stylesheet" href="../assets/stylesheets/application-a422ff04cc.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:400,700|Ubuntu+Mono">
<style>
body, input {
font-family: 'Ubuntu', Helvetica, Arial, sans-serif;
}
pre, code {
font-family: 'Ubuntu Mono', 'Courier New', 'Courier', monospace;
}
</style>
<link rel="stylesheet" href="../assets/Documenter.css">
<script src="../assets/javascripts/modernizr-4ab42b99fd.js"></script>
</head>
<body class=" ">
<div class="backdrop">
<div class="backdrop-paper"></div>
</div>
<input class="toggle" type="checkbox" id="toggle-drawer">
<input class="toggle" type="checkbox" id="toggle-search">
<label class="toggle-button overlay" for="toggle-drawer"></label>
<header class="header">
<nav aria-label="Header">
<div class="bar default">
<div class="button button-menu" role="button" aria-label="Menu">
<label class="toggle-button icon icon-menu" for="toggle-drawer">
<span></span>
</label>
</div>
<div class="stretch">
<div class="title">
<span class="path">
</span>
Working with Jupyter notebooks
</div>
</div>
<div class="button button-twitter" role="button" aria-label="Twitter">
<a href="https://twitter.com/mpastell" title="@mpastell on Twitter" target="_blank" class="toggle-button icon icon-twitter"></a>
</div>
<div class="button button-search" role="button" aria-label="Search">
<label class="toggle-button icon icon-search" title="Search" for="toggle-search"></label>
</div>
</div>
<div class="bar search">
<div class="button button-close" role="button" aria-label="Close">
<label class="toggle-button icon icon-back" for="toggle-search"></label>
</div>
<div class="stretch">
<div class="field">
<input class="query" type="text" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck>
</div>
</div>
<div class="button button-reset" role="button" aria-label="Search">
<button class="toggle-button icon icon-close" id="reset-search"></button>
</div>
</div>
</nav>
</header>
<main class="main">
<div class="drawer">
<nav aria-label="Navigation">
<a href="https://github.com/mpastell/Weave.jl" class="project">
<div class="banner">
<div class="name">
<strong>
Weave.jl
<span class="version">
v0.4.0
</span>
</strong>
<br>
mpastell/Weave.jl
</div>
</div>
</a>
<div class="scrollable">
<div class="wrapper">
<ul class="repo">
<li class="repo-download">
<a href="https://github.com/mpastell/Weave.jl/archive/v0.4.0.zip" target="_blank" title="Download" data-action="download">
<i class="icon icon-download"></i> Download
</a>
</li>
<li class="repo-stars">
<a href="https://github.com/mpastell/Weave.jl/stargazers" target="_blank" title="Stargazers" data-action="star">
<i class="icon icon-star"></i> Stars
<span class="count">&ndash;</span>
</a>
</li>
</ul>
<hr>
<div class="toc">
<ul>
<li>
<a class="" title="Home" href="..">
Home
</a>
</li>
<li>
<a class="" title="Getting started" href="../getting_started/">
Getting started
</a>
</li>
<li>
<a class="" title="Using Weave" href="../usage/">
Using Weave
</a>
</li>
<li>
<a class="" title="Publishing scripts" href="../publish/">
Publishing scripts
</a>
</li>
<li>
<a class="" title="Chunk options" href="../chunk_options/">
Chunk options
</a>
</li>
<li>
<a class="current" title="Working with Jupyter notebooks" href="./">
Working with Jupyter notebooks
</a>
<ul>
<li class="anchor">
<a title="Weaving" href="#weaving">
Weaving
</a>
</li>
<li class="anchor">
<a title="Converting between formats" href="#converting-between-formats">
Converting between formats
</a>
</li>
</ul>
</li>
<li>
<a class="" title="Function index" href="../function_index/">
Function index
</a>
</li>
</ul>
<hr>
<span class="section">The author</span>
<ul>
<li>
<a href="https://twitter.com/mpastell" target="_blank" title="@mpastell on Twitter">
@mpastell on Twitter
</a>
</li>
</ul>
</div>
</div>
</div>
</nav>
</div>
<article class="article">
<div class="wrapper">
<p><a id='Working-with-Jupyter-notebooks-1'></a></p>
<h1 id="working-with-jupyter-notebooks">Working with Jupyter notebooks</h1>
<p><a id='Weaving-1'></a></p>
<h2 id="weaving">Weaving</h2>
<p>Weave supports using Jupyter notebooks as input format, this means you can weave notebooks to any supported formats. You can't use chunk options with notebooks.</p>
<div class="code"><pre><span></span><span class="n">weave</span><span class="p">(</span><span class="s">&quot;notebook.ipynb&quot;</span><span class="p">)</span>
</pre></div>
<p>In order to output notebooks from other formats you need to convert the document to a notebook and run the code using IJulia.</p>
<p><a id='Converting-between-formats-1'></a></p>
<h2 id="converting-between-formats">Converting between formats</h2>
<p>You can convert between all supported input formats using the <code>convert_doc</code> function.</p>
<p>To convert from script to notebook:</p>
<div class="code"><pre><span></span><span class="n">convert_doc</span><span class="p">(</span><span class="s">&quot;examples/FIR_design.jl&quot;</span><span class="p">,</span> <span class="s">&quot;FIR_design.ipynb&quot;</span><span class="p">)</span>
</pre></div>
<p>and from notebooks to markdown use:</p>
<div class="code"><pre><span></span><span class="n">convert_doc</span><span class="p">(</span><span class="s">&quot;FIR_design.ipynb&quot;</span><span class="p">,</span> <span class="s">&quot;FIR_design.jmd&quot;</span><span class="p">)</span>
</pre></div>
<p><a id='Weave.convert_doc-Tuple{String,String}' href='#Weave.convert_doc-Tuple{String,String}'>#</a>
<strong><code>Weave.convert_doc</code></strong> &mdash; <em>Method</em>.</p>
<p><code>convert_doc(infile::AbstractString, outfile::AbstractString; format = nothing)</code></p>
<p>Convert Weave documents between different formats</p>
<ul>
<li><code>infile</code> = Name of the input document</li>
<li><code>outfile</code> = Name of the output document</li>
<li><code>format</code> = Output format (optional). Detected from outfile extension, but can be set to <code>"script"</code>, <code>"markdown"</code>, <code>"notebook"</code> or <code>"noweb"</code>.</li>
</ul>
<aside class="copyright" role="note">
Matti Pastell 2016 &ndash;
Documentation built with
<a href="http://www.mkdocs.org" target="_blank">MkDocs</a>
using the
<a href="http://squidfunk.github.io/mkdocs-material/" target="_blank">
Material
</a>
theme.
</aside>
<footer class="footer">
<nav class="pagination" aria-label="Footer">
<div class="previous">
<a href="../chunk_options/" title="Chunk options">
<span class="direction">
Previous
</span>
<div class="page">
<div class="button button-previous" role="button" aria-label="Previous">
<i class="icon icon-back"></i>
</div>
<div class="stretch">
<div class="title">
Chunk options
</div>
</div>
</div>
</a>
</div>
<div class="next">
<a href="../function_index/" title="Function index">
<span class="direction">
Next
</span>
<div class="page">
<div class="stretch">
<div class="title">
Function index
</div>
</div>
<div class="button button-next" role="button" aria-label="Next">
<i class="icon icon-forward"></i>
</div>
</div>
</a>
</div>
</nav>
</footer>
</div>
</article>
<div class="results" role="status" aria-live="polite">
<div class="scrollable">
<div class="wrapper">
<div class="meta"></div>
<div class="list"></div>
</div>
</div>
</div>
</main>
<script>
var base_url = '..';
var repo_id = 'mpastell/Weave.jl';
</script>
<script src="../assets/javascripts/application-997097ee0c.js"></script>
<script src="../assets/mathjaxhelper.js"></script>
<script>
(function(i,s,o,g,r,a,m){
i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||
[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;
m.parentNode.insertBefore(a,m)
})(window, document,
'script', 'https://www.google-analytics.com/analytics.js', 'ga');
/* General initialization */
ga('create', 'UA-6474352-10', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
/* Track outbound links */
var buttons = document.querySelectorAll('a');
Array.prototype.map.call(buttons, function(item) {
if (item.host != document.location.host) {
item.addEventListener('click', function() {
var action = item.getAttribute('data-action') || 'follow';
ga('send', 'event', 'outbound', action, item.href);
});
}
});
/* Register handler to log search on blur */
var query = document.querySelector('.query');
query.addEventListener('blur', function() {
if (this.value) {
var path = document.location.pathname;
ga('send', 'pageview', path + '?q=' + this.value);
}
});
</script>
</body>
</html>

408
v0.4.1/publish/index.html Normal file
View File

@ -0,0 +1,408 @@
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="no-js ie6"><![endif]-->
<!--[if IE 7 ]><html class="no-js ie7"><![endif]-->
<!--[if IE 8 ]><html class="no-js ie8"><![endif]-->
<!--[if IE 9 ]><html class="no-js ie9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1">
<title>Publishing scripts - Weave.jl</title>
<meta name="author" content="Matti Pastell">
<meta property="og:url" content="None">
<meta property="og:title" content="Weave.jl">
<meta property="og:image" content="None/../">
<meta name="apple-mobile-web-app-title" content="Weave.jl">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="shortcut icon" type="image/x-icon" href="../assets/images/favicon-e565ddfa3b.ico">
<link rel="icon" type="image/x-icon" href="../assets/images/favicon-e565ddfa3b.ico">
<style>
@font-face {
font-family: 'Icon';
src: url('../assets/fonts/icon.eot?52m981');
src: url('../assets/fonts/icon.eot?#iefix52m981')
format('embedded-opentype'),
url('../assets/fonts/icon.woff?52m981')
format('woff'),
url('../assets/fonts/icon.ttf?52m981')
format('truetype'),
url('../assets/fonts/icon.svg?52m981#icon')
format('svg');
font-weight: normal;
font-style: normal;
}
</style>
<link rel="stylesheet" href="../assets/stylesheets/application-a422ff04cc.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:400,700|Ubuntu+Mono">
<style>
body, input {
font-family: 'Ubuntu', Helvetica, Arial, sans-serif;
}
pre, code {
font-family: 'Ubuntu Mono', 'Courier New', 'Courier', monospace;
}
</style>
<link rel="stylesheet" href="../assets/Documenter.css">
<script src="../assets/javascripts/modernizr-4ab42b99fd.js"></script>
</head>
<body class=" ">
<div class="backdrop">
<div class="backdrop-paper"></div>
</div>
<input class="toggle" type="checkbox" id="toggle-drawer">
<input class="toggle" type="checkbox" id="toggle-search">
<label class="toggle-button overlay" for="toggle-drawer"></label>
<header class="header">
<nav aria-label="Header">
<div class="bar default">
<div class="button button-menu" role="button" aria-label="Menu">
<label class="toggle-button icon icon-menu" for="toggle-drawer">
<span></span>
</label>
</div>
<div class="stretch">
<div class="title">
<span class="path">
</span>
Publishing scripts
</div>
</div>
<div class="button button-twitter" role="button" aria-label="Twitter">
<a href="https://twitter.com/mpastell" title="@mpastell on Twitter" target="_blank" class="toggle-button icon icon-twitter"></a>
</div>
<div class="button button-search" role="button" aria-label="Search">
<label class="toggle-button icon icon-search" title="Search" for="toggle-search"></label>
</div>
</div>
<div class="bar search">
<div class="button button-close" role="button" aria-label="Close">
<label class="toggle-button icon icon-back" for="toggle-search"></label>
</div>
<div class="stretch">
<div class="field">
<input class="query" type="text" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck>
</div>
</div>
<div class="button button-reset" role="button" aria-label="Search">
<button class="toggle-button icon icon-close" id="reset-search"></button>
</div>
</div>
</nav>
</header>
<main class="main">
<div class="drawer">
<nav aria-label="Navigation">
<a href="https://github.com/mpastell/Weave.jl" class="project">
<div class="banner">
<div class="name">
<strong>
Weave.jl
<span class="version">
v0.4.0
</span>
</strong>
<br>
mpastell/Weave.jl
</div>
</div>
</a>
<div class="scrollable">
<div class="wrapper">
<ul class="repo">
<li class="repo-download">
<a href="https://github.com/mpastell/Weave.jl/archive/v0.4.0.zip" target="_blank" title="Download" data-action="download">
<i class="icon icon-download"></i> Download
</a>
</li>
<li class="repo-stars">
<a href="https://github.com/mpastell/Weave.jl/stargazers" target="_blank" title="Stargazers" data-action="star">
<i class="icon icon-star"></i> Stars
<span class="count">&ndash;</span>
</a>
</li>
</ul>
<hr>
<div class="toc">
<ul>
<li>
<a class="" title="Home" href="..">
Home
</a>
</li>
<li>
<a class="" title="Getting started" href="../getting_started/">
Getting started
</a>
</li>
<li>
<a class="" title="Using Weave" href="../usage/">
Using Weave
</a>
</li>
<li>
<a class="current" title="Publishing scripts" href="./">
Publishing scripts
</a>
<ul>
<li class="anchor">
<a title="Templates" href="#templates">
Templates
</a>
</li>
</ul>
</li>
<li>
<a class="" title="Chunk options" href="../chunk_options/">
Chunk options
</a>
</li>
<li>
<a class="" title="Working with Jupyter notebooks" href="../notebooks/">
Working with Jupyter notebooks
</a>
</li>
<li>
<a class="" title="Function index" href="../function_index/">
Function index
</a>
</li>
</ul>
<hr>
<span class="section">The author</span>
<ul>
<li>
<a href="https://twitter.com/mpastell" target="_blank" title="@mpastell on Twitter">
@mpastell on Twitter
</a>
</li>
</ul>
</div>
</div>
</div>
</nav>
</div>
<article class="article">
<div class="wrapper">
<p><a id='Publishing-to-html-and-pdf-1'></a></p>
<h1 id="publishing-to-html-and-pdf">Publishing to html and pdf</h1>
<p>You can also publish any supported input format using markdown for doc chunks to html and pdf documents. Producing pdf output requires that you have pdflatex installed and in your path. <em>The markdown variant is <a href="http://docs.julialang.org/en/latest/manual/documentation.html#Markdown-syntax-1">Julia markdown</a></em>.</p>
<p>You can use a YAML header in the beginning of the input document delimited with "-" to set the document title, author and date e.g.</p>
<div class="code"><pre><span></span>---
title : Weave example
author : Matti Pastell
date: 15th December 2016
---
</pre></div>
<p>Here is a a sample document and output:</p>
<p><a href="../examples/FIR_design.jl">FIR_design.jl</a>, <a href="../examples/FIR_design.html">FIR_design.html</a> , <a href="../examples/FIR_design.pdf">FIR_design.pdf</a>.</p>
<div class="code"><pre><span></span><span class="n">weave</span><span class="p">(</span><span class="s">&quot;FIR_design.jl&quot;</span><span class="p">)</span>
<span class="n">weave</span><span class="p">(</span><span class="s">&quot;FIR_design.jl&quot;</span><span class="p">,</span> <span class="n">docformat</span> <span class="o">=</span> <span class="s">&quot;md2pdf&quot;</span><span class="p">)</span>
</pre></div>
<p><strong>Note:</strong> docformats <code>md2pdf</code> and <code>md2html</code> use Julia markdown and <code>pandoc2pdf</code> and <code>pandoc2html</code> use Pandoc.</p>
<p><a id='Templates-1'></a></p>
<h2 id="templates">Templates</h2>
<p>You can use a custom template with <code>md2pdf</code> and <code>md2html</code> formats with <code>template</code> argument (e.g) <code>weave("FIR_design.jl", template = "custom.tpl"</code>). You can use the existing templates as starting point.</p>
<p>For HTML: <a href="https://github.com/mpastell/Weave.jl/blob/master/templates/julia_html.tpl">julia_html.tpl</a> and LaTex: <a href="https://github.com/mpastell/Weave.jl/blob/master/templates/julia_tex.tpl">julia_tex.tpl</a></p>
<p>Templates are rendered using <a href="https://github.com/jverzani/Mustache.jl">Mustache.jl</a>.</p>
<aside class="copyright" role="note">
Matti Pastell 2016 &ndash;
Documentation built with
<a href="http://www.mkdocs.org" target="_blank">MkDocs</a>
using the
<a href="http://squidfunk.github.io/mkdocs-material/" target="_blank">
Material
</a>
theme.
</aside>
<footer class="footer">
<nav class="pagination" aria-label="Footer">
<div class="previous">
<a href="../usage/" title="Using Weave">
<span class="direction">
Previous
</span>
<div class="page">
<div class="button button-previous" role="button" aria-label="Previous">
<i class="icon icon-back"></i>
</div>
<div class="stretch">
<div class="title">
Using Weave
</div>
</div>
</div>
</a>
</div>
<div class="next">
<a href="../chunk_options/" title="Chunk options">
<span class="direction">
Next
</span>
<div class="page">
<div class="stretch">
<div class="title">
Chunk options
</div>
</div>
<div class="button button-next" role="button" aria-label="Next">
<i class="icon icon-forward"></i>
</div>
</div>
</a>
</div>
</nav>
</footer>
</div>
</article>
<div class="results" role="status" aria-live="polite">
<div class="scrollable">
<div class="wrapper">
<div class="meta"></div>
<div class="list"></div>
</div>
</div>
</div>
</main>
<script>
var base_url = '..';
var repo_id = 'mpastell/Weave.jl';
</script>
<script src="../assets/javascripts/application-997097ee0c.js"></script>
<script src="../assets/mathjaxhelper.js"></script>
<script>
(function(i,s,o,g,r,a,m){
i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||
[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;
m.parentNode.insertBefore(a,m)
})(window, document,
'script', 'https://www.google-analytics.com/analytics.js', 'ga');
/* General initialization */
ga('create', 'UA-6474352-10', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
/* Track outbound links */
var buttons = document.querySelectorAll('a');
Array.prototype.map.call(buttons, function(item) {
if (item.host != document.location.host) {
item.addEventListener('click', function() {
var action = item.getAttribute('data-action') || 'follow';
ga('send', 'event', 'outbound', action, item.href);
});
}
});
/* Register handler to log search on blur */
var query = document.querySelector('.query');
query.addEventListener('blur', function() {
if (this.value) {
var path = document.location.pathname;
ga('send', 'pageview', path + '?q=' + this.value);
}
});
</script>
</body>
</html>

60
v0.4.1/sitemap.xml Normal file
View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>/</loc>
<lastmod>2017-03-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/getting_started/</loc>
<lastmod>2017-03-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/usage/</loc>
<lastmod>2017-03-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/publish/</loc>
<lastmod>2017-03-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/chunk_options/</loc>
<lastmod>2017-03-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/notebooks/</loc>
<lastmod>2017-03-06</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/function_index/</loc>
<lastmod>2017-03-06</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>

599
v0.4.1/usage/index.html Normal file
View File

@ -0,0 +1,599 @@
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="no-js ie6"><![endif]-->
<!--[if IE 7 ]><html class="no-js ie7"><![endif]-->
<!--[if IE 8 ]><html class="no-js ie8"><![endif]-->
<!--[if IE 9 ]><html class="no-js ie9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1">
<title>Using Weave - Weave.jl</title>
<meta name="author" content="Matti Pastell">
<meta property="og:url" content="None">
<meta property="og:title" content="Weave.jl">
<meta property="og:image" content="None/../">
<meta name="apple-mobile-web-app-title" content="Weave.jl">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="shortcut icon" type="image/x-icon" href="../assets/images/favicon-e565ddfa3b.ico">
<link rel="icon" type="image/x-icon" href="../assets/images/favicon-e565ddfa3b.ico">
<style>
@font-face {
font-family: 'Icon';
src: url('../assets/fonts/icon.eot?52m981');
src: url('../assets/fonts/icon.eot?#iefix52m981')
format('embedded-opentype'),
url('../assets/fonts/icon.woff?52m981')
format('woff'),
url('../assets/fonts/icon.ttf?52m981')
format('truetype'),
url('../assets/fonts/icon.svg?52m981#icon')
format('svg');
font-weight: normal;
font-style: normal;
}
</style>
<link rel="stylesheet" href="../assets/stylesheets/application-a422ff04cc.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:400,700|Ubuntu+Mono">
<style>
body, input {
font-family: 'Ubuntu', Helvetica, Arial, sans-serif;
}
pre, code {
font-family: 'Ubuntu Mono', 'Courier New', 'Courier', monospace;
}
</style>
<link rel="stylesheet" href="../assets/Documenter.css">
<script src="../assets/javascripts/modernizr-4ab42b99fd.js"></script>
</head>
<body class=" ">
<div class="backdrop">
<div class="backdrop-paper"></div>
</div>
<input class="toggle" type="checkbox" id="toggle-drawer">
<input class="toggle" type="checkbox" id="toggle-search">
<label class="toggle-button overlay" for="toggle-drawer"></label>
<header class="header">
<nav aria-label="Header">
<div class="bar default">
<div class="button button-menu" role="button" aria-label="Menu">
<label class="toggle-button icon icon-menu" for="toggle-drawer">
<span></span>
</label>
</div>
<div class="stretch">
<div class="title">
<span class="path">
</span>
Using Weave
</div>
</div>
<div class="button button-twitter" role="button" aria-label="Twitter">
<a href="https://twitter.com/mpastell" title="@mpastell on Twitter" target="_blank" class="toggle-button icon icon-twitter"></a>
</div>
<div class="button button-search" role="button" aria-label="Search">
<label class="toggle-button icon icon-search" title="Search" for="toggle-search"></label>
</div>
</div>
<div class="bar search">
<div class="button button-close" role="button" aria-label="Close">
<label class="toggle-button icon icon-back" for="toggle-search"></label>
</div>
<div class="stretch">
<div class="field">
<input class="query" type="text" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck>
</div>
</div>
<div class="button button-reset" role="button" aria-label="Search">
<button class="toggle-button icon icon-close" id="reset-search"></button>
</div>
</div>
</nav>
</header>
<main class="main">
<div class="drawer">
<nav aria-label="Navigation">
<a href="https://github.com/mpastell/Weave.jl" class="project">
<div class="banner">
<div class="name">
<strong>
Weave.jl
<span class="version">
v0.4.0
</span>
</strong>
<br>
mpastell/Weave.jl
</div>
</div>
</a>
<div class="scrollable">
<div class="wrapper">
<ul class="repo">
<li class="repo-download">
<a href="https://github.com/mpastell/Weave.jl/archive/v0.4.0.zip" target="_blank" title="Download" data-action="download">
<i class="icon icon-download"></i> Download
</a>
</li>
<li class="repo-stars">
<a href="https://github.com/mpastell/Weave.jl/stargazers" target="_blank" title="Stargazers" data-action="star">
<i class="icon icon-star"></i> Stars
<span class="count">&ndash;</span>
</a>
</li>
</ul>
<hr>
<div class="toc">
<ul>
<li>
<a class="" title="Home" href="..">
Home
</a>
</li>
<li>
<a class="" title="Getting started" href="../getting_started/">
Getting started
</a>
</li>
<li>
<a class="current" title="Using Weave" href="./">
Using Weave
</a>
<ul>
<li class="anchor">
<a title="Weave" href="#weave">
Weave
</a>
</li>
<li class="anchor">
<a title="Weave from shell" href="#weave-from-shell">
Weave from shell
</a>
</li>
<li class="anchor">
<a title="Tangle" href="#tangle">
Tangle
</a>
</li>
<li class="anchor">
<a title="Supported formats" href="#supported-formats">
Supported formats
</a>
</li>
<li class="anchor">
<a title="Document syntax" href="#document-syntax">
Document syntax
</a>
</li>
<li class="anchor">
<a title="Noweb format" href="#noweb-format">
Noweb format
</a>
</li>
<li class="anchor">
<a title="Markdown format" href="#markdown-format">
Markdown format
</a>
</li>
<li class="anchor">
<a title="Script format" href="#script-format">
Script format
</a>
</li>
<li class="anchor">
<a title="Inline code" href="#inline-code">
Inline code
</a>
</li>
<li class="anchor">
<a title="Passing arguments to documents" href="#passing-arguments-to-documents">
Passing arguments to documents
</a>
</li>
</ul>
</li>
<li>
<a class="" title="Publishing scripts" href="../publish/">
Publishing scripts
</a>
</li>
<li>
<a class="" title="Chunk options" href="../chunk_options/">
Chunk options
</a>
</li>
<li>
<a class="" title="Working with Jupyter notebooks" href="../notebooks/">
Working with Jupyter notebooks
</a>
</li>
<li>
<a class="" title="Function index" href="../function_index/">
Function index
</a>
</li>
</ul>
<hr>
<span class="section">The author</span>
<ul>
<li>
<a href="https://twitter.com/mpastell" target="_blank" title="@mpastell on Twitter">
@mpastell on Twitter
</a>
</li>
</ul>
</div>
</div>
</div>
</nav>
</div>
<article class="article">
<div class="wrapper">
<p><a id='Using-Weave-1'></a></p>
<h1 id="using-weave">Using Weave</h1>
<p>You can write your documentation and code in input document using Noweb, Markdown or script syntax and use <code>weave</code> function to execute to document to capture results and figures.</p>
<p><a id='Weave-1'></a></p>
<h2 id="weave">Weave</h2>
<p>Weave document with markup and julia code using Gadfly for plots, <code>out_path = :pwd</code> makes the results appear in the current working directory.</p>
<div class="code"><pre><span></span><span class="k">using</span> <span class="n">Weave</span>
<span class="n">weave</span><span class="p">(</span><span class="n">Pkg</span><span class="o">.</span><span class="n">dir</span><span class="p">(</span><span class="s">&quot;Weave&quot;</span><span class="p">,</span><span class="s">&quot;examples&quot;</span><span class="p">,</span><span class="s">&quot;gadfly_sample.mdw&quot;</span><span class="p">),</span> <span class="n">out_path</span> <span class="o">=</span> <span class="o">:</span><span class="n">pwd</span><span class="p">)</span>
</pre></div>
<p>Using PyPlot:</p>
<div class="code"><pre><span></span><span class="n">weave</span><span class="p">(</span><span class="n">Pkg</span><span class="o">.</span><span class="n">dir</span><span class="p">(</span><span class="s">&quot;Weave&quot;</span><span class="p">,</span><span class="s">&quot;examples&quot;</span><span class="p">,</span><span class="s">&quot;julia_sample.mdw&quot;</span><span class="p">),</span> <span class="n">plotlib</span><span class="o">=</span><span class="s">&quot;PyPlot&quot;</span><span class="p">,</span> <span class="n">out_path</span> <span class="o">=</span> <span class="o">:</span><span class="n">pwd</span><span class="p">)</span>
</pre></div>
<p><a id='Weave.weave-Tuple{Any}' href='#Weave.weave-Tuple{Any}'>#</a>
<strong><code>Weave.weave</code></strong> &mdash; <em>Method</em>.</p>
<div class="code"><pre><span></span>weave(source ; doctype = :auto, plotlib=:auto,
informat=:auto, out_path=:doc, args = Dict(),
fig_path = &quot;figures&quot;, fig_ext = nothing,
cache_path = &quot;cache&quot;, cache=:off,
template = nothing, highlight_theme = nothing, css = nothing
latex_cmd = &quot;pdflatex&quot;)
</pre></div>
<p>Weave an input document to output file.</p>
<ul>
<li><code>doctype</code>: :auto = set based on file extension or specify one of the supported formats. See <code>list_out_formats()</code></li>
<li><code>plotlib</code>: <code>"PyPlot"</code>, <code>"Gadfly"</code> or <code>nothing</code></li>
<li><code>informat</code>: :auto = set based on file extension or set to <code>"noweb"</code>, <code>"markdown"</code> or <code>script</code></li>
<li><code>out_path</code>: Path where the output is generated. Can be: <code>:doc</code>: Path of the source document, <code>:pwd</code>: Julia working directory, <code>"somepath"</code>: output directory as a String e.g <code>"/home/mpastell/weaveout"</code> or filename as string e.g. ~/outpath/outfile.tex.</li>
<li><code>args</code>: dictionary of arguments to pass to document. Available as WEAVE_ARGS</li>
<li><code>fig_path</code>: where figures will be generated, relative to out_path</li>
<li><code>fig_ext</code>: Extension for saved figures e.g. <code>".pdf"</code>, <code>".png"</code>. Default setting depends on <code>doctype</code>.</li>
<li><code>cache_path</code>: where of cached output will be saved.</li>
<li><code>cache</code>: controls caching of code: <code>:off</code> = no caching, <code>:all</code> = cache everything, <code>:user</code> = cache based on chunk options, <code>:refresh</code>, run all code chunks and save new cache.</li>
<li><code>template</code> : Template (file path) for md2html or md2tex formats.</li>
<li><code>highlight_theme</code> : Theme (Highlights.AbstractTheme) for used syntax highlighting</li>
<li><code>css</code> : CSS (file path) used for md2html format</li>
<li><code>latex_cmd</code> the command used to make pdf from .tex</li>
</ul>
<p><strong>Note:</strong> Run Weave from terminal and not using IJulia, Juno or ESS, they tend to mess with capturing output.</p>
<p><a id='Weave-from-shell-1'></a></p>
<h2 id="weave-from-shell">Weave from shell</h2>
<p>You can also use the <code>weave.jl</code> script under bin directory to weave documents from the shell:</p>
<div class="code"><pre><span></span>$ ./weave.jl
usage: weave.jl <span class="o">[</span>--doctype DOCTYPE<span class="o">]</span> <span class="o">[</span>--plotlib PLOTLIB<span class="o">]</span>
<span class="o">[</span>--informat INFORMAT<span class="o">]</span> <span class="o">[</span>--out_path OUT_PATH<span class="o">]</span>
<span class="o">[</span>--fig_path FIG_PATH<span class="o">]</span> <span class="o">[</span>--fig_ext FIG_EXT<span class="o">]</span> source...
</pre></div>
<p><a id='Tangle-1'></a></p>
<h2 id="tangle">Tangle</h2>
<p>Tangling extracts the code from document:</p>
<p><a id='Weave.tangle-Tuple{Any}' href='#Weave.tangle-Tuple{Any}'>#</a>
<strong><code>Weave.tangle</code></strong> &mdash; <em>Method</em>.</p>
<p><code>tangle(source ; out_path=:doc, informat="noweb")</code></p>
<p>Tangle source code from input document to .jl file.</p>
<ul>
<li><code>informat</code>: <code>"noweb"</code> of <code>"markdown"</code></li>
<li><code>out_path</code>: Path where the output is generated. Can be: <code>:doc</code>: Path of the source document, <code>:pwd</code>: Julia working directory, <code>"somepath"</code>, directory name as a string e.g <code>"/home/mpastell/weaveout"</code></li>
</ul>
<p>or filename as string e.g. ~/outpath/outfile.jl.</p>
<p><a id='Supported-formats-1'></a></p>
<h2 id="supported-formats">Supported formats</h2>
<p>Weave sets the output format based on the file extension, but you can also set it using <code>doctype</code> option. The rules for detecting the format are:</p>
<div class="code"><pre><span></span><span class="n">ext</span> <span class="o">==</span> <span class="s">&quot;.jl&quot;</span> <span class="o">&amp;&amp;</span> <span class="k">return</span> <span class="s">&quot;md2html&quot;</span>
<span class="n">contains</span><span class="p">(</span><span class="n">ext</span><span class="p">,</span> <span class="s">&quot;.md&quot;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">return</span> <span class="s">&quot;md2html&quot;</span>
<span class="n">contains</span><span class="p">(</span><span class="n">ext</span><span class="p">,</span> <span class="s">&quot;.rst&quot;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">return</span> <span class="s">&quot;rst&quot;</span>
<span class="n">contains</span><span class="p">(</span><span class="n">ext</span><span class="p">,</span> <span class="s">&quot;.tex&quot;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">return</span> <span class="s">&quot;texminted&quot;</span>
<span class="n">contains</span><span class="p">(</span><span class="n">ext</span><span class="p">,</span> <span class="s">&quot;.txt&quot;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">return</span> <span class="s">&quot;asciidoc&quot;</span>
<span class="k">return</span> <span class="s">&quot;pandoc&quot;</span>
</pre></div>
<p>You can get a list of supported output formats:</p>
<div class="code"><pre><span></span><span class="n">list_out_formats</span><span class="p">()</span>
</pre></div>
<div class="code"><pre><span></span><span class="n">github</span><span class="o">:</span> <span class="n">Github</span> <span class="n">markdown</span>
<span class="n">md2tex</span><span class="o">:</span> <span class="n">Julia</span> <span class="n">markdown</span> <span class="n">to</span> <span class="n">latex</span>
<span class="n">pandoc2html</span><span class="o">:</span> <span class="n">Markdown</span> <span class="n">to</span> <span class="n">HTML</span> <span class="o">(</span><span class="n">requires</span> <span class="n">Pandoc</span><span class="o">)</span>
<span class="n">pandoc</span><span class="o">:</span> <span class="n">Pandoc</span> <span class="n">markdown</span>
<span class="n">pandoc2pdf</span><span class="o">:</span> <span class="n">Pandoc</span> <span class="n">markdown</span>
<span class="n">tex</span><span class="o">:</span> <span class="n">Latex</span> <span class="k">with</span> <span class="n">custom</span> <span class="n">code</span> <span class="n">environments</span>
<span class="n">texminted</span><span class="o">:</span> <span class="n">Latex</span> <span class="n">using</span> <span class="n">minted</span> <span class="k">for</span> <span class="n">highlighting</span>
<span class="n">md2html</span><span class="o">:</span> <span class="n">Julia</span> <span class="n">markdown</span> <span class="n">to</span> <span class="n">html</span>
<span class="n">rst</span><span class="o">:</span> <span class="n">reStructuredText</span> <span class="n">and</span> <span class="n">Sphinx</span>
<span class="n">multimarkdown</span><span class="o">:</span> <span class="n">MultiMarkdown</span>
<span class="n">md2pdf</span><span class="o">:</span> <span class="n">Julia</span> <span class="n">markdown</span> <span class="n">to</span> <span class="n">latex</span>
<span class="n">asciidoc</span><span class="o">:</span> <span class="n">AsciiDoc</span>
</pre></div>
<p><a id='Weave.list_out_formats-Tuple{}' href='#Weave.list_out_formats-Tuple{}'>#</a>
<strong><code>Weave.list_out_formats</code></strong> &mdash; <em>Method</em>.</p>
<p><code>list_out_formats()</code></p>
<p>List supported output formats</p>
<p><a id='Document-syntax-1'></a></p>
<h2 id="document-syntax">Document syntax</h2>
<p>Weave uses noweb, markdown or script syntax for defining the code chunks and documentation chunks. You can also weave Jupyter notebooks. The format is detected based on the file extension, but you can also set it manually using the <code>informat</code> parameter.</p>
<p>The rules for autodetection are:</p>
<div class="code"><pre><span></span><span class="n">ext</span> <span class="o">==</span> <span class="s">&quot;.jl&quot;</span> <span class="o">&amp;&amp;</span> <span class="k">return</span> <span class="s">&quot;script&quot;</span>
<span class="n">ext</span> <span class="o">==</span> <span class="s">&quot;.jmd&quot;</span> <span class="o">&amp;&amp;</span> <span class="k">return</span> <span class="s">&quot;markdown&quot;</span>
<span class="n">ext</span> <span class="o">==</span> <span class="s">&quot;.ipynb&quot;</span> <span class="o">&amp;&amp;</span> <span class="k">return</span> <span class="s">&quot;notebook&quot;</span>
<span class="k">return</span> <span class="s">&quot;noweb&quot;</span>
</pre></div>
<p><a id='Noweb-format-1'></a></p>
<h2 id="noweb-format">Noweb format</h2>
<p><a id='Code-chunks-1'></a></p>
<h3 id="code-chunks">Code chunks</h3>
<p>start with a line marked with <code>&lt;&lt;&gt;&gt;=</code> or <code>&lt;&lt;options&gt;&gt;=</code> and end with line marked with <code>@</code>. The code between the start and end markers is executed and the output is captured to the output document. See <a href="../../chunk_options/">chunk options</a>.</p>
<p><a id='Documentation-chunks-1'></a></p>
<h3 id="documentation-chunks">Documentation chunks</h3>
<p>Are the rest of the document (between <code>@</code> and <code>&lt;&lt;&gt;&gt;=</code> lines and the first chunk be default) and can be written with several different markup languages.</p>
<p><a href="https://github.com/mpastell/Weave.jl/blob/master/examples/julia_sample.mdw">Sample document</a></p>
<p><a id='Markdown-format-1'></a></p>
<h2 id="markdown-format">Markdown format</h2>
<p>Markdown code chunks are defined using fenced code blocks with options following on the same line. e.g. to hide code from output you can use:</p>
<p><code>```julia; echo=false</code></p>
<p><a href="https://github.com/mpastell/Weave.jl/blob/master/examples/gadfly_md_sample.jmd">See sample document:</a></p>
<p><a id='Script-format-1'></a></p>
<h2 id="script-format">Script format</h2>
<p>Weave also support script input format with a markup in comments. These scripts can be executed normally using Julia or published with Weave. Documentation is in lines starting with <code>#'</code>, <code>#%%</code> or <code># %%</code>, and code is executed and results are included in the weaved document.</p>
<p>All lines that are not documentation are treated as code. You can set chunk options using lines starting with <code>#+</code> just before code e.g. <code>#+ term=true</code>.</p>
<p>The format is identical to <a href="http://mpastell.com/pweave/pypublish.html">Pweave</a> and the concept is similar to publishing documents with MATLAB or using Knitr's <a href="http://yihui.name/knitr/demo/stitch/">spin</a>. Weave will remove the first empty space from each line of documentation.</p>
<p><a href="https://github.com/mpastell/Weave.jl/blob/master/examples/FIR_design.jl">See sample document:</a></p>
<p><a id='Inline-code-1'></a></p>
<h2 id="inline-code">Inline code</h2>
<p>You can also add inline code to your documents using</p>
<div class="code"><pre><span></span>`j juliacode`
</pre></div>
<p>syntax. The code will be replaced with the output of running the code. If the code produces figures the filename or base64 encoded string will be added to output e.g. to include a Plots figure in markdown you can use:</p>
<div class="code"><pre><span></span><span class="o">!</span><span class="p">[</span><span class="n">A</span> <span class="n">plot</span><span class="p">](</span><span class="err">`</span><span class="n">j</span> <span class="n">plot</span><span class="p">(</span><span class="mi">1</span><span class="o">:</span><span class="mi">10</span><span class="p">)</span><span class="err">`</span><span class="p">)</span>
</pre></div>
<p><a id='Passing-arguments-to-documents-1'></a></p>
<h2 id="passing-arguments-to-documents">Passing arguments to documents</h2>
<p>You can pass arguments as dictionary to the weaved document using the <code>args</code> argument to <code>weave</code>. The dictionary will be available as <code>WEAVE_ARGS</code> variable in the document.</p>
<p>This makes it possible to create the same report easily for e.g. different date ranges of input data from a database or from files with similar format giving the filename as input. </p>
<p>In order to pass a filename to a document you need call <code>weave</code> using:</p>
<div class="code"><pre><span></span><span class="n">weave</span><span class="p">(</span><span class="s">&quot;mydoc.jmd&quot;</span><span class="p">,</span> <span class="n">args</span> <span class="o">=</span> <span class="kt">Dict</span><span class="p">(</span><span class="s">&quot;filename&quot;</span> <span class="o">=&gt;</span> <span class="s">&quot;somedata.h5&quot;</span><span class="p">))</span>
</pre></div>
<p>and you can access the filename from document as follows:</p>
<div class="code"><pre><span></span> ```julia
print(WEAVE_ARGS[&quot;filename&quot;])
```
</pre></div>
<p>You can use the <code>out_path</code> argument to control the name of the output document.</p>
<aside class="copyright" role="note">
Matti Pastell 2016 &ndash;
Documentation built with
<a href="http://www.mkdocs.org" target="_blank">MkDocs</a>
using the
<a href="http://squidfunk.github.io/mkdocs-material/" target="_blank">
Material
</a>
theme.
</aside>
<footer class="footer">
<nav class="pagination" aria-label="Footer">
<div class="previous">
<a href="../getting_started/" title="Getting started">
<span class="direction">
Previous
</span>
<div class="page">
<div class="button button-previous" role="button" aria-label="Previous">
<i class="icon icon-back"></i>
</div>
<div class="stretch">
<div class="title">
Getting started
</div>
</div>
</div>
</a>
</div>
<div class="next">
<a href="../publish/" title="Publishing scripts">
<span class="direction">
Next
</span>
<div class="page">
<div class="stretch">
<div class="title">
Publishing scripts
</div>
</div>
<div class="button button-next" role="button" aria-label="Next">
<i class="icon icon-forward"></i>
</div>
</div>
</a>
</div>
</nav>
</footer>
</div>
</article>
<div class="results" role="status" aria-live="polite">
<div class="scrollable">
<div class="wrapper">
<div class="meta"></div>
<div class="list"></div>
</div>
</div>
</div>
</main>
<script>
var base_url = '..';
var repo_id = 'mpastell/Weave.jl';
</script>
<script src="../assets/javascripts/application-997097ee0c.js"></script>
<script src="../assets/mathjaxhelper.js"></script>
<script>
(function(i,s,o,g,r,a,m){
i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||
[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;
m.parentNode.insertBefore(a,m)
})(window, document,
'script', 'https://www.google-analytics.com/analytics.js', 'ga');
/* General initialization */
ga('create', 'UA-6474352-10', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
/* Track outbound links */
var buttons = document.querySelectorAll('a');
Array.prototype.map.call(buttons, function(item) {
if (item.host != document.location.host) {
item.addEventListener('click', function() {
var action = item.getAttribute('data-action') || 'follow';
ga('send', 'event', 'outbound', action, item.href);
});
}
});
/* Register handler to log search on blur */
var query = document.querySelector('.query');
query.addEventListener('blur', function() {
if (this.value) {
var path = document.location.pathname;
ga('send', 'pageview', path + '?q=' + this.value);
}
});
</script>
</body>
</html>