Release v0.1.1 as new stable

gh-pages
Matti Pastell 2016-04-24 16:09:29 +03:00
parent dbc5f8733e
commit 0e62cc2376
39 changed files with 4147 additions and 304 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -9,110 +9,110 @@
stroke-width="0.3"
font-size="3.88"
>
<g class="plotroot xscalable yscalable" id="img-f06526f4-1">
<g font-size="3.88" font-family="'PT Sans','Helvetica Neue','Helvetica',sans-serif" fill="#564A55" stroke="#000000" stroke-opacity="0.000" id="img-f06526f4-2">
<g class="plotroot xscalable yscalable" id="img-c3f404a7-1">
<g font-size="3.88" font-family="'PT Sans','Helvetica Neue','Helvetica',sans-serif" fill="#564A55" stroke="#000000" stroke-opacity="0.000" id="img-c3f404a7-2">
<text x="82.67" y="89.99" text-anchor="middle" dy="0.6em">x</text>
</g>
<g class="guide xlabels" font-size="2.82" font-family="'PT Sans Caption','Helvetica Neue','Helvetica',sans-serif" fill="#6C606B" id="img-f06526f4-3">
<g class="guide xlabels" font-size="2.82" font-family="'PT Sans Caption','Helvetica Neue','Helvetica',sans-serif" fill="#6C606B" id="img-c3f404a7-3">
<text x="19.94" y="83.32" text-anchor="middle" dy="0.6em">0</text>
<text x="51.3" y="83.32" text-anchor="middle" dy="0.6em">2</text>
<text x="82.67" y="83.32" text-anchor="middle" dy="0.6em">4</text>
<text x="114.03" y="83.32" text-anchor="middle" dy="0.6em">6</text>
<text x="145.4" y="83.32" text-anchor="middle" dy="0.6em">8</text>
</g>
<g clip-path="url(#img-f06526f4-4)">
<g id="img-f06526f4-5">
<g pointer-events="visible" opacity="1" fill="#000000" fill-opacity="0.000" stroke="#000000" stroke-opacity="0.000" class="guide background" id="img-f06526f4-6">
<g clip-path="url(#img-c3f404a7-4)">
<g id="img-c3f404a7-5">
<g pointer-events="visible" opacity="1" fill="#000000" fill-opacity="0.000" stroke="#000000" stroke-opacity="0.000" class="guide background" id="img-c3f404a7-6">
<rect x="17.94" y="5" width="129.46" height="77.32"/>
</g>
<g class="guide ygridlines xfixed" stroke-dasharray="0.5,0.5" stroke-width="0.2" stroke="#D0D0E0" id="img-f06526f4-7">
<g class="guide ygridlines xfixed" stroke-dasharray="0.5,0.5" stroke-width="0.2" stroke="#D0D0E0" id="img-c3f404a7-7">
<path fill="none" d="M17.94,80.32 L 147.4 80.32"/>
<path fill="none" d="M17.94,61.99 L 147.4 61.99"/>
<path fill="none" d="M17.94,43.66 L 147.4 43.66"/>
<path fill="none" d="M17.94,25.33 L 147.4 25.33"/>
<path fill="none" d="M17.94,7 L 147.4 7"/>
</g>
<g class="guide xgridlines yfixed" stroke-dasharray="0.5,0.5" stroke-width="0.2" stroke="#D0D0E0" id="img-f06526f4-8">
<g class="guide xgridlines yfixed" stroke-dasharray="0.5,0.5" stroke-width="0.2" stroke="#D0D0E0" id="img-c3f404a7-8">
<path fill="none" d="M19.94,5 L 19.94 82.32"/>
<path fill="none" d="M51.3,5 L 51.3 82.32"/>
<path fill="none" d="M82.67,5 L 82.67 82.32"/>
<path fill="none" d="M114.03,5 L 114.03 82.32"/>
<path fill="none" d="M145.4,5 L 145.4 82.32"/>
</g>
<g class="plotpanel" id="img-f06526f4-9">
<g class="geometry" id="img-f06526f4-10">
<g class="color_RGBA{Float32}(0.0f0,0.74736935f0,1.0f0,1.0f0)" stroke="#FFFFFF" stroke-width="0.3" fill="#00BFFF" id="img-f06526f4-11">
<use xlink:href="#img-f06526f4-12" x="19.94" y="43.66"/>
<use xlink:href="#img-f06526f4-12" x="21.95" y="38.97"/>
<use xlink:href="#img-f06526f4-12" x="23.96" y="34.36"/>
<use xlink:href="#img-f06526f4-12" x="25.97" y="29.9"/>
<use xlink:href="#img-f06526f4-12" x="27.98" y="25.67"/>
<use xlink:href="#img-f06526f4-12" x="29.99" y="21.73"/>
<use xlink:href="#img-f06526f4-12" x="32" y="18.16"/>
<use xlink:href="#img-f06526f4-12" x="34.02" y="15"/>
<use xlink:href="#img-f06526f4-12" x="36.03" y="12.31"/>
<use xlink:href="#img-f06526f4-12" x="38.04" y="10.14"/>
<use xlink:href="#img-f06526f4-12" x="40.05" y="8.52"/>
<use xlink:href="#img-f06526f4-12" x="42.06" y="7.47"/>
<use xlink:href="#img-f06526f4-12" x="44.07" y="7.02"/>
<use xlink:href="#img-f06526f4-12" x="46.08" y="7.17"/>
<use xlink:href="#img-f06526f4-12" x="48.09" y="7.92"/>
<use xlink:href="#img-f06526f4-12" x="50.1" y="9.26"/>
<use xlink:href="#img-f06526f4-12" x="52.11" y="11.16"/>
<use xlink:href="#img-f06526f4-12" x="54.13" y="13.59"/>
<use xlink:href="#img-f06526f4-12" x="56.14" y="16.52"/>
<use xlink:href="#img-f06526f4-12" x="58.15" y="19.9"/>
<use xlink:href="#img-f06526f4-12" x="60.16" y="23.66"/>
<use xlink:href="#img-f06526f4-12" x="62.17" y="27.75"/>
<use xlink:href="#img-f06526f4-12" x="64.18" y="32.11"/>
<use xlink:href="#img-f06526f4-12" x="66.19" y="36.65"/>
<use xlink:href="#img-f06526f4-12" x="68.2" y="41.31"/>
<use xlink:href="#img-f06526f4-12" x="70.21" y="46.01"/>
<use xlink:href="#img-f06526f4-12" x="72.22" y="50.66"/>
<use xlink:href="#img-f06526f4-12" x="74.23" y="55.21"/>
<use xlink:href="#img-f06526f4-12" x="76.25" y="59.56"/>
<use xlink:href="#img-f06526f4-12" x="78.26" y="63.66"/>
<use xlink:href="#img-f06526f4-12" x="80.27" y="67.42"/>
<use xlink:href="#img-f06526f4-12" x="82.28" y="70.79"/>
<use xlink:href="#img-f06526f4-12" x="84.29" y="73.72"/>
<use xlink:href="#img-f06526f4-12" x="86.3" y="76.16"/>
<use xlink:href="#img-f06526f4-12" x="88.31" y="78.06"/>
<use xlink:href="#img-f06526f4-12" x="90.32" y="79.4"/>
<use xlink:href="#img-f06526f4-12" x="92.33" y="80.15"/>
<use xlink:href="#img-f06526f4-12" x="94.34" y="80.3"/>
<use xlink:href="#img-f06526f4-12" x="96.36" y="79.85"/>
<use xlink:href="#img-f06526f4-12" x="98.37" y="78.8"/>
<use xlink:href="#img-f06526f4-12" x="100.38" y="77.18"/>
<use xlink:href="#img-f06526f4-12" x="102.39" y="75"/>
<use xlink:href="#img-f06526f4-12" x="104.4" y="72.32"/>
<use xlink:href="#img-f06526f4-12" x="106.41" y="69.16"/>
<use xlink:href="#img-f06526f4-12" x="108.42" y="65.58"/>
<use xlink:href="#img-f06526f4-12" x="110.43" y="61.65"/>
<use xlink:href="#img-f06526f4-12" x="112.44" y="57.41"/>
<use xlink:href="#img-f06526f4-12" x="114.45" y="52.96"/>
<use xlink:href="#img-f06526f4-12" x="116.46" y="48.35"/>
<use xlink:href="#img-f06526f4-12" x="118.48" y="43.66"/>
<g class="plotpanel" id="img-c3f404a7-9">
<g class="geometry" id="img-c3f404a7-10">
<g class="color_RGBA{Float32}(0.0f0,0.74736935f0,1.0f0,1.0f0)" stroke="#FFFFFF" stroke-width="0.3" fill="#00BFFF" id="img-c3f404a7-11">
<use xlink:href="#img-c3f404a7-12" x="19.94" y="43.66"/>
<use xlink:href="#img-c3f404a7-12" x="21.95" y="38.97"/>
<use xlink:href="#img-c3f404a7-12" x="23.96" y="34.36"/>
<use xlink:href="#img-c3f404a7-12" x="25.97" y="29.9"/>
<use xlink:href="#img-c3f404a7-12" x="27.98" y="25.67"/>
<use xlink:href="#img-c3f404a7-12" x="29.99" y="21.73"/>
<use xlink:href="#img-c3f404a7-12" x="32" y="18.16"/>
<use xlink:href="#img-c3f404a7-12" x="34.02" y="15"/>
<use xlink:href="#img-c3f404a7-12" x="36.03" y="12.31"/>
<use xlink:href="#img-c3f404a7-12" x="38.04" y="10.14"/>
<use xlink:href="#img-c3f404a7-12" x="40.05" y="8.52"/>
<use xlink:href="#img-c3f404a7-12" x="42.06" y="7.47"/>
<use xlink:href="#img-c3f404a7-12" x="44.07" y="7.02"/>
<use xlink:href="#img-c3f404a7-12" x="46.08" y="7.17"/>
<use xlink:href="#img-c3f404a7-12" x="48.09" y="7.92"/>
<use xlink:href="#img-c3f404a7-12" x="50.1" y="9.26"/>
<use xlink:href="#img-c3f404a7-12" x="52.11" y="11.16"/>
<use xlink:href="#img-c3f404a7-12" x="54.13" y="13.59"/>
<use xlink:href="#img-c3f404a7-12" x="56.14" y="16.52"/>
<use xlink:href="#img-c3f404a7-12" x="58.15" y="19.9"/>
<use xlink:href="#img-c3f404a7-12" x="60.16" y="23.66"/>
<use xlink:href="#img-c3f404a7-12" x="62.17" y="27.75"/>
<use xlink:href="#img-c3f404a7-12" x="64.18" y="32.11"/>
<use xlink:href="#img-c3f404a7-12" x="66.19" y="36.65"/>
<use xlink:href="#img-c3f404a7-12" x="68.2" y="41.31"/>
<use xlink:href="#img-c3f404a7-12" x="70.21" y="46.01"/>
<use xlink:href="#img-c3f404a7-12" x="72.22" y="50.66"/>
<use xlink:href="#img-c3f404a7-12" x="74.23" y="55.21"/>
<use xlink:href="#img-c3f404a7-12" x="76.25" y="59.56"/>
<use xlink:href="#img-c3f404a7-12" x="78.26" y="63.66"/>
<use xlink:href="#img-c3f404a7-12" x="80.27" y="67.42"/>
<use xlink:href="#img-c3f404a7-12" x="82.28" y="70.79"/>
<use xlink:href="#img-c3f404a7-12" x="84.29" y="73.72"/>
<use xlink:href="#img-c3f404a7-12" x="86.3" y="76.16"/>
<use xlink:href="#img-c3f404a7-12" x="88.31" y="78.06"/>
<use xlink:href="#img-c3f404a7-12" x="90.32" y="79.4"/>
<use xlink:href="#img-c3f404a7-12" x="92.33" y="80.15"/>
<use xlink:href="#img-c3f404a7-12" x="94.34" y="80.3"/>
<use xlink:href="#img-c3f404a7-12" x="96.36" y="79.85"/>
<use xlink:href="#img-c3f404a7-12" x="98.37" y="78.8"/>
<use xlink:href="#img-c3f404a7-12" x="100.38" y="77.18"/>
<use xlink:href="#img-c3f404a7-12" x="102.39" y="75"/>
<use xlink:href="#img-c3f404a7-12" x="104.4" y="72.32"/>
<use xlink:href="#img-c3f404a7-12" x="106.41" y="69.16"/>
<use xlink:href="#img-c3f404a7-12" x="108.42" y="65.58"/>
<use xlink:href="#img-c3f404a7-12" x="110.43" y="61.65"/>
<use xlink:href="#img-c3f404a7-12" x="112.44" y="57.41"/>
<use xlink:href="#img-c3f404a7-12" x="114.45" y="52.96"/>
<use xlink:href="#img-c3f404a7-12" x="116.46" y="48.35"/>
<use xlink:href="#img-c3f404a7-12" x="118.48" y="43.66"/>
</g>
</g>
</g>
</g>
</g>
<g class="guide ylabels" font-size="2.82" font-family="'PT Sans Caption','Helvetica Neue','Helvetica',sans-serif" fill="#6C606B" id="img-f06526f4-13">
<g class="guide ylabels" font-size="2.82" font-family="'PT Sans Caption','Helvetica Neue','Helvetica',sans-serif" fill="#6C606B" id="img-c3f404a7-13">
<text x="16.94" y="80.32" text-anchor="end" dy="0.35em">-1.0</text>
<text x="16.94" y="61.99" text-anchor="end" dy="0.35em">-0.5</text>
<text x="16.94" y="43.66" text-anchor="end" dy="0.35em">0.0</text>
<text x="16.94" y="25.33" text-anchor="end" dy="0.35em">0.5</text>
<text x="16.94" y="7" text-anchor="end" dy="0.35em">1.0</text>
</g>
<g font-size="3.88" font-family="'PT Sans','Helvetica Neue','Helvetica',sans-serif" fill="#564A55" stroke="#000000" stroke-opacity="0.000" id="img-f06526f4-14">
<g font-size="3.88" font-family="'PT Sans','Helvetica Neue','Helvetica',sans-serif" fill="#564A55" stroke="#000000" stroke-opacity="0.000" id="img-c3f404a7-14">
<text x="8.81" y="43.66" text-anchor="end" dy="0.35em">y</text>
</g>
</g>
<defs>
<clipPath id="img-f06526f4-4">
<clipPath id="img-c3f404a7-4">
<path d="M17.94,5 L 147.4 5 147.4 82.32 17.94 82.32" />
</clipPath>
<g id="img-f06526f4-12">
<g id="img-c3f404a7-12">
<circle cx="0" cy="0" r="0.9"/>
</g>
</defs>

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 53 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -27,7 +27,7 @@
},
{
"location": "/usage/",
"text": "Using Weave\n\n\nYou can write your documentation and code in input document using Noweb or Markdown syntax and use \nweave\n function to execute to document to capture results and figures.\n\n\n\n\nWeave\n\n\nWeave document with markup and julia code using Gadfly for plots, \nout_path = :pwd\n makes the results appear in the current working directory.\n\n\nusing Weave\nweave(Pkg.dir(\"Weave\",\"examples\",\"gadfly_sample.mdw\"), out_path = :pwd)\n\n\n\n\nUsing PyPlot:\n\n\nweave(Pkg.dir(\"Weave\",\"examples\",\"julia_sample.mdw\"), plotlib=\"PyPlot\", out_path = :pwd)\n\n\n\n\n#\n\n\nWeave.weave\n \u2014 \nMethod\n.\n\n\n\n\nfunction weave(source ; doctype = :auto, plotlib=\"Gadfly\", informat=:auto, out_path=:doc, fig_path = \"figures\", fig_ext = nothing, cache_path = \"cache\", cache=:off)\n\n\nWeave an input document to output file.\n\n\n\n\ndoctype\n: :auto = set based on file extension or specify one of the supported formats. See \nlist_out_formats()\n\n\nplotlib\n: \n\"PyPlot\"\n, \n\"Gadfly\"\n or \nnothing\n\n\ninformat\n: :auto = set based on file extension or set to \n\"noweb\"\n, \n\"markdown\"\n or \nscript\n\n\nout_path\n: Path where the output is generated. Can be: \n:doc\n: Path of the source document, \n:pwd\n: Julia working directory, \n\"somepath\"\n: Path as a String e.g \n\"/home/mpastell/weaveout\"\n\n\nfig_path\n: where figures will be generated, relative to out_path\n\n\nfig_ext\n: Extension for saved figures e.g. \n\".pdf\"\n, \n\".png\"\n. Default setting depends on \ndoctype\n.\n\n\ncache_path\n: where of cached output will be saved.\n\n\ncache\n: controls caching of code: \n:off\n = no caching, \n:all\n = cache everything, \n:user\n = cache based on chunk options, \n:refresh\n, run all code chunks and save new cache.\n\n\n\n\nNote:\n Run Weave from terminal and not using IJulia, Juno or ESS, they tend to mess with capturing output.\n\n\n\n\nWeave from shell\n\n\nYou can also use the \nweave.jl\n script under bin directory to weave documents from the shell:\n\n\n$ ./weave.jl\nusage: weave.jl [--doctype DOCTYPE] [--plotlib PLOTLIB]\n [--informat INFORMAT] [--out_path OUT_PATH]\n [--fig_path FIG_PATH] [--fig_ext FIG_EXT] source...\n\n\n\n\n\n\nTangle\n\n\nTangling extracts the code from document:\n\n\n#\n\n\nWeave.tangle\n \u2014 \nMethod\n.\n\n\n\n\ntangle(source ; out_path=:doc, informat=\"noweb\")\n\n\nTangle source code from input document to .jl file.\n\n\n\n\ninformat\n: \n\"noweb\"\n of \n\"markdown\"\n\n\nout_path\n: Path where the output is generated. Can be: \n:doc\n: Path of the source document, \n:pwd\n: Julia working directory, \n\"somepath\"\n: Path as a AbstractString e.g \n\"/home/mpastell/weaveout\"\n\n\n\n\n\n\nSupported formats\n\n\nWeave sets the output format based on the file extension, but you can also set it using \ndoctype\n option. The rules for detecting the format are:\n\n\next == \".jl\" && return \"md2html\"\ncontains(ext, \".md\") && return \"md2html\"\ncontains(ext, \".rst\") && return \"rst\"\ncontains(ext, \".tex\") && return \"texminted\"\ncontains(ext, \".txt\") && return \"asciidoc\"\nreturn \"pandoc\"\n\n\n\n\nYou can get a list of supported output formats:\n\n\njulia> list_out_formats()\npandoc: Pandoc markdown\nrst: reStructuredText and Sphinx\ntexminted: Latex using minted for highlighting\ngithub: Github markdown\nmd2html: Markdown to HTML (requires Pandoc)\nmd2pdf: Markdown to pdf (requires Pandoc and xelatex)\nasciidoc: AsciiDoc\ntex: Latex with custom code environments\n\n\n\n\n#\n\n\nWeave.list_out_formats\n \u2014 \nMethod\n.\n\n\n\n\nlist_out_formats()\n\n\nList supported output formats\n\n\n\n\nDocument syntax\n\n\nWeave uses noweb, markdown or script syntax for defining the code chunks and documentation chunks. The format is detected based on the file extension, but you can also set it manually using the \ninformat\n parameter.\n\n\nThe rules for autodetection are:\n\n\next == \".jl\" && return \"script\"\next == \".jmd\" && return \"markdown\"\nreturn \"noweb\"\n\n\n\n\n\n\nNoweb\n\n\n\n\nCode chunks\n\n\nstart with a line marked with \n<<>>=\n or \n<<options>>=\n and end with line marked with \n@\n. The code between the start and end markers is executed and the output is captured to the output document. See for options below.\n\n\n\n\nDocumentation chunks\n\n\nAre the rest of the document (between \n@\n and \n<<>>=\n lines and the first chunk be default) and can be written with several different markup languages.\n\n\nSample document\n\n\n\n\nMarkdown\n\n\nMarkdown code chunks are defined using fenced code blocks. \nSee sample document:",
"text": "Using Weave\n\n\nYou can write your documentation and code in input document using Noweb or Markdown syntax and use \nweave\n function to execute to document to capture results and figures.\n\n\n\n\nWeave\n\n\nWeave document with markup and julia code using Gadfly for plots, \nout_path = :pwd\n makes the results appear in the current working directory.\n\n\nusing Weave\nweave(Pkg.dir(\"Weave\",\"examples\",\"gadfly_sample.mdw\"), out_path = :pwd)\n\n\n\n\nUsing PyPlot:\n\n\nweave(Pkg.dir(\"Weave\",\"examples\",\"julia_sample.mdw\"), plotlib=\"PyPlot\", out_path = :pwd)\n\n\n\n\n#\n\n\nWeave.weave\n \u2014 \nMethod\n.\n\n\n\n\nfunction weave(source ; doctype = :auto, plotlib=\"Gadfly\", informat=:auto, out_path=:doc, fig_path = \"figures\", fig_ext = nothing, cache_path = \"cache\", cache=:off)\n\n\nWeave an input document to output file.\n\n\n\n\ndoctype\n: :auto = set based on file extension or specify one of the supported formats. See \nlist_out_formats()\n\n\nplotlib\n: \n\"PyPlot\"\n, \n\"Gadfly\"\n or \nnothing\n\n\ninformat\n: :auto = set based on file extension or set to \n\"noweb\"\n, \n\"markdown\"\n or \nscript\n\n\nout_path\n: Path where the output is generated. Can be: \n:doc\n: Path of the source document, \n:pwd\n: Julia working directory, \n\"somepath\"\n: output directory as a String e.g \n\"/home/mpastell/weaveout\"\n or filename as string e.g. ~/outpath/outfile.tex.\n\n\nfig_path\n: where figures will be generated, relative to out_path\n\n\nfig_ext\n: Extension for saved figures e.g. \n\".pdf\"\n, \n\".png\"\n. Default setting depends on \ndoctype\n.\n\n\ncache_path\n: where of cached output will be saved.\n\n\ncache\n: controls caching of code: \n:off\n = no caching, \n:all\n = cache everything, \n:user\n = cache based on chunk options, \n:refresh\n, run all code chunks and save new cache.\n\n\n\n\nNote:\n Run Weave from terminal and not using IJulia, Juno or ESS, they tend to mess with capturing output.\n\n\n\n\nWeave from shell\n\n\nYou can also use the \nweave.jl\n script under bin directory to weave documents from the shell:\n\n\n$ ./weave.jl\nusage: weave.jl [--doctype DOCTYPE] [--plotlib PLOTLIB]\n [--informat INFORMAT] [--out_path OUT_PATH]\n [--fig_path FIG_PATH] [--fig_ext FIG_EXT] source...\n\n\n\n\n\n\nTangle\n\n\nTangling extracts the code from document:\n\n\n#\n\n\nWeave.tangle\n \u2014 \nMethod\n.\n\n\n\n\ntangle(source ; out_path=:doc, informat=\"noweb\")\n\n\nTangle source code from input document to .jl file.\n\n\n\n\ninformat\n: \n\"noweb\"\n of \n\"markdown\"\n\n\nout_path\n: Path where the output is generated. Can be: \n:doc\n: Path of the source document, \n:pwd\n: Julia working directory, \n\"somepath\"\n, directory name as a string e.g \n\"/home/mpastell/weaveout\"\n or filename as string e.g. ~/outpath/outfile.jl.\n\n\n\n\n\n\nSupported formats\n\n\nWeave sets the output format based on the file extension, but you can also set it using \ndoctype\n option. The rules for detecting the format are:\n\n\next == \".jl\" && return \"md2html\"\ncontains(ext, \".md\") && return \"md2html\"\ncontains(ext, \".rst\") && return \"rst\"\ncontains(ext, \".tex\") && return \"texminted\"\ncontains(ext, \".txt\") && return \"asciidoc\"\nreturn \"pandoc\"\n\n\n\n\nYou can get a list of supported output formats:\n\n\njulia> list_out_formats()\npandoc: Pandoc markdown\nrst: reStructuredText and Sphinx\ntexminted: Latex using minted for highlighting\ngithub: Github markdown\nmd2html: Markdown to HTML (requires Pandoc)\nmd2pdf: Markdown to pdf (requires Pandoc and xelatex)\nasciidoc: AsciiDoc\ntex: Latex with custom code environments\n\n\n\n\n#\n\n\nWeave.list_out_formats\n \u2014 \nMethod\n.\n\n\n\n\nlist_out_formats()\n\n\nList supported output formats\n\n\n\n\nDocument syntax\n\n\nWeave uses noweb, markdown or script syntax for defining the code chunks and documentation chunks. The format is detected based on the file extension, but you can also set it manually using the \ninformat\n parameter.\n\n\nThe rules for autodetection are:\n\n\next == \".jl\" && return \"script\"\next == \".jmd\" && return \"markdown\"\nreturn \"noweb\"\n\n\n\n\n\n\nNoweb\n\n\n\n\nCode chunks\n\n\nstart with a line marked with \n<<>>=\n or \n<<options>>=\n and end with line marked with \n@\n. The code between the start and end markers is executed and the output is captured to the output document. See for options below.\n\n\n\n\nDocumentation chunks\n\n\nAre the rest of the document (between \n@\n and \n<<>>=\n lines and the first chunk be default) and can be written with several different markup languages.\n\n\nSample document\n\n\n\n\nMarkdown\n\n\nMarkdown code chunks are defined using fenced code blocks. \nSee sample document:",
"title": "Using Weave"
},
{
@ -37,7 +37,7 @@
},
{
"location": "/usage/#weave",
"text": "Weave document with markup and julia code using Gadfly for plots, out_path = :pwd makes the results appear in the current working directory. using Weave\nweave(Pkg.dir(\"Weave\",\"examples\",\"gadfly_sample.mdw\"), out_path = :pwd) Using PyPlot: weave(Pkg.dir(\"Weave\",\"examples\",\"julia_sample.mdw\"), plotlib=\"PyPlot\", out_path = :pwd) # Weave.weave \u2014 Method . function weave(source ; doctype = :auto, plotlib=\"Gadfly\", informat=:auto, out_path=:doc, fig_path = \"figures\", fig_ext = nothing, cache_path = \"cache\", cache=:off) Weave an input document to output file. doctype : :auto = set based on file extension or specify one of the supported formats. See list_out_formats() plotlib : \"PyPlot\" , \"Gadfly\" or nothing informat : :auto = set based on file extension or set to \"noweb\" , \"markdown\" or script out_path : Path where the output is generated. Can be: :doc : Path of the source document, :pwd : Julia working directory, \"somepath\" : Path as a String e.g \"/home/mpastell/weaveout\" fig_path : where figures will be generated, relative to out_path fig_ext : Extension for saved figures e.g. \".pdf\" , \".png\" . Default setting depends on doctype . cache_path : where of cached output will be saved. cache : controls caching of code: :off = no caching, :all = cache everything, :user = cache based on chunk options, :refresh , run all code chunks and save new cache. Note: Run Weave from terminal and not using IJulia, Juno or ESS, they tend to mess with capturing output.",
"text": "Weave document with markup and julia code using Gadfly for plots, out_path = :pwd makes the results appear in the current working directory. using Weave\nweave(Pkg.dir(\"Weave\",\"examples\",\"gadfly_sample.mdw\"), out_path = :pwd) Using PyPlot: weave(Pkg.dir(\"Weave\",\"examples\",\"julia_sample.mdw\"), plotlib=\"PyPlot\", out_path = :pwd) # Weave.weave \u2014 Method . function weave(source ; doctype = :auto, plotlib=\"Gadfly\", informat=:auto, out_path=:doc, fig_path = \"figures\", fig_ext = nothing, cache_path = \"cache\", cache=:off) Weave an input document to output file. doctype : :auto = set based on file extension or specify one of the supported formats. See list_out_formats() plotlib : \"PyPlot\" , \"Gadfly\" or nothing informat : :auto = set based on file extension or set to \"noweb\" , \"markdown\" or script out_path : Path where the output is generated. Can be: :doc : Path of the source document, :pwd : Julia working directory, \"somepath\" : output directory as a String e.g \"/home/mpastell/weaveout\" or filename as string e.g. ~/outpath/outfile.tex. fig_path : where figures will be generated, relative to out_path fig_ext : Extension for saved figures e.g. \".pdf\" , \".png\" . Default setting depends on doctype . cache_path : where of cached output will be saved. cache : controls caching of code: :off = no caching, :all = cache everything, :user = cache based on chunk options, :refresh , run all code chunks and save new cache. Note: Run Weave from terminal and not using IJulia, Juno or ESS, they tend to mess with capturing output.",
"title": "Weave"
},
{
@ -47,7 +47,7 @@
},
{
"location": "/usage/#tangle",
"text": "Tangling extracts the code from document: # Weave.tangle \u2014 Method . tangle(source ; out_path=:doc, informat=\"noweb\") Tangle source code from input document to .jl file. informat : \"noweb\" of \"markdown\" out_path : Path where the output is generated. Can be: :doc : Path of the source document, :pwd : Julia working directory, \"somepath\" : Path as a AbstractString e.g \"/home/mpastell/weaveout\"",
"text": "Tangling extracts the code from document: # Weave.tangle \u2014 Method . tangle(source ; out_path=:doc, informat=\"noweb\") Tangle source code from input document to .jl file. informat : \"noweb\" of \"markdown\" out_path : Path where the output is generated. Can be: :doc : Path of the source document, :pwd : Julia working directory, \"somepath\" , directory name as a string e.g \"/home/mpastell/weaveout\" or filename as string e.g. ~/outpath/outfile.jl.",
"title": "Tangle"
},
{

View File

@ -4,7 +4,7 @@
<url>
<loc>None/</loc>
<lastmod>2016-04-22</lastmod>
<lastmod>2016-04-24</lastmod>
<changefreq>daily</changefreq>
</url>
@ -12,7 +12,7 @@
<url>
<loc>None/getting_started/</loc>
<lastmod>2016-04-22</lastmod>
<lastmod>2016-04-24</lastmod>
<changefreq>daily</changefreq>
</url>
@ -20,7 +20,7 @@
<url>
<loc>None/usage/</loc>
<lastmod>2016-04-22</lastmod>
<lastmod>2016-04-24</lastmod>
<changefreq>daily</changefreq>
</url>
@ -28,7 +28,7 @@
<url>
<loc>None/publish/</loc>
<lastmod>2016-04-22</lastmod>
<lastmod>2016-04-24</lastmod>
<changefreq>daily</changefreq>
</url>
@ -36,7 +36,7 @@
<url>
<loc>None/chunk_options/</loc>
<lastmod>2016-04-22</lastmod>
<lastmod>2016-04-24</lastmod>
<changefreq>daily</changefreq>
</url>
@ -44,7 +44,7 @@
<url>
<loc>None/function_index/</loc>
<lastmod>2016-04-22</lastmod>
<lastmod>2016-04-24</lastmod>
<changefreq>daily</changefreq>
</url>

View File

@ -302,7 +302,7 @@ weave(Pkg.dir(&quot;Weave&quot;,&quot;examples&quot;,&quot;gadfly_sample.mdw&quo
<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>: Path as a String e.g <code>"/home/mpastell/weaveout"</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>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>
@ -328,7 +328,7 @@ usage: weave.jl [--doctype DOCTYPE] [--plotlib PLOTLIB]
<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>: Path as a AbstractString e.g <code>"/home/mpastell/weaveout"</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> or filename as string e.g. ~/outpath/outfile.jl.</li>
</ul>
<p><a id='Supported-formats-1'></a></p>
<h2 id="supported-formats">Supported formats</h2>

Binary file not shown.

View File

@ -0,0 +1,407 @@
<!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 - Scientific Reports Using Julia</title>
<meta name="author" content="Matti Pastell">
<meta property="og:url" content="None">
<meta property="og:title" content="Weave.jl - Scientific Reports Using Julia">
<meta property="og:image" content="None/../">
<meta name="apple-mobile-web-app-title" content="Weave.jl - Scientific Reports Using Julia">
<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="../None">
<link rel="icon" type="image/x-icon" href="../None">
<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-54f87043f3.css">
<link rel="stylesheet" href="../assets/stylesheets/palettes-05ab2406df.css">
<link rel="stylesheet" href="//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="palette-primary-indigo palette-accent-blue">
<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-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 - Scientific Reports Using Julia
<span class="version">
</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/master.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="Function index" href="../function_index/">
Function index
</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>
<pre><code class="julia">&lt;&lt;fig_width=5; echo=false &gt;&gt;=
using Gadfly
x = linspace(0, 2π, 200)
plot(x=x, y = sin(x), Geom.line)
@
</code></pre>
<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>
<pre><code>&lt;&lt;echo = false&gt;&gt;=
import Weave
Weave.set_chunk_defaults(Dict{Symbol, Any}(
:out_width =&gt; &quot;\\0.5linewidth&quot;,
:results =&gt; &quot;tex&quot;
))
@
</code></pre>
<p><a id='Weave.set_chunk_defaults-Tuple{Any}' href='#Weave.set_chunk_defaults-Tuple{Any}'>#</a>
<strong><code>Weave.set_chunk_defaults</code></strong> &mdash; <em>Method</em>.</p>
<hr />
<p><code>set_chunk_defaults(opts::Dict{Symbol, Any})</code></p>
<p>Set default options for code chunks, use get_chunk_defaults to see the current values.</p>
<p>e.g. set default dpi to 200 and fig_width to 8</p>
<pre><code>julia&gt; set_chunk_defaults(Dict{Symbol, Any}(:dpi =&gt; 200, fig_width =&gt; 8))
</code></pre>
<p><a id='Weave.get_chunk_defaults-Tuple{}' href='#Weave.get_chunk_defaults-Tuple{}'>#</a>
<strong><code>Weave.get_chunk_defaults</code></strong> &mdash; <em>Method</em>.</p>
<hr />
<p><code>get_chunk_defaults()</code></p>
<p>Get default options used for code chunks.</p>
<p><a id='Weave.restore_chunk_defaults-Tuple{}' href='#Weave.restore_chunk_defaults-Tuple{}'>#</a>
<strong><code>Weave.restore_chunk_defaults</code></strong> &mdash; <em>Method</em>.</p>
<hr />
<p><code>restore_chunk_defaults()</code></p>
<p>Restore Weave.jl default chunk options</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="../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="../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>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,79 @@
#' % FIR filter design with Julia
#' % Matti Pastell
#' % 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.

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -0,0 +1,119 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:gadfly="http://www.gadflyjl.org/ns"
version="1.2"
width="152.4mm" height="101.6mm" viewBox="0 0 152.4 101.6"
stroke="none"
fill="#000000"
stroke-width="0.3"
font-size="3.88"
>
<g class="plotroot xscalable yscalable" id="img-c3f404a7-1">
<g font-size="3.88" font-family="'PT Sans','Helvetica Neue','Helvetica',sans-serif" fill="#564A55" stroke="#000000" stroke-opacity="0.000" id="img-c3f404a7-2">
<text x="82.67" y="89.99" text-anchor="middle" dy="0.6em">x</text>
</g>
<g class="guide xlabels" font-size="2.82" font-family="'PT Sans Caption','Helvetica Neue','Helvetica',sans-serif" fill="#6C606B" id="img-c3f404a7-3">
<text x="19.94" y="83.32" text-anchor="middle" dy="0.6em">0</text>
<text x="51.3" y="83.32" text-anchor="middle" dy="0.6em">2</text>
<text x="82.67" y="83.32" text-anchor="middle" dy="0.6em">4</text>
<text x="114.03" y="83.32" text-anchor="middle" dy="0.6em">6</text>
<text x="145.4" y="83.32" text-anchor="middle" dy="0.6em">8</text>
</g>
<g clip-path="url(#img-c3f404a7-4)">
<g id="img-c3f404a7-5">
<g pointer-events="visible" opacity="1" fill="#000000" fill-opacity="0.000" stroke="#000000" stroke-opacity="0.000" class="guide background" id="img-c3f404a7-6">
<rect x="17.94" y="5" width="129.46" height="77.32"/>
</g>
<g class="guide ygridlines xfixed" stroke-dasharray="0.5,0.5" stroke-width="0.2" stroke="#D0D0E0" id="img-c3f404a7-7">
<path fill="none" d="M17.94,80.32 L 147.4 80.32"/>
<path fill="none" d="M17.94,61.99 L 147.4 61.99"/>
<path fill="none" d="M17.94,43.66 L 147.4 43.66"/>
<path fill="none" d="M17.94,25.33 L 147.4 25.33"/>
<path fill="none" d="M17.94,7 L 147.4 7"/>
</g>
<g class="guide xgridlines yfixed" stroke-dasharray="0.5,0.5" stroke-width="0.2" stroke="#D0D0E0" id="img-c3f404a7-8">
<path fill="none" d="M19.94,5 L 19.94 82.32"/>
<path fill="none" d="M51.3,5 L 51.3 82.32"/>
<path fill="none" d="M82.67,5 L 82.67 82.32"/>
<path fill="none" d="M114.03,5 L 114.03 82.32"/>
<path fill="none" d="M145.4,5 L 145.4 82.32"/>
</g>
<g class="plotpanel" id="img-c3f404a7-9">
<g class="geometry" id="img-c3f404a7-10">
<g class="color_RGBA{Float32}(0.0f0,0.74736935f0,1.0f0,1.0f0)" stroke="#FFFFFF" stroke-width="0.3" fill="#00BFFF" id="img-c3f404a7-11">
<use xlink:href="#img-c3f404a7-12" x="19.94" y="43.66"/>
<use xlink:href="#img-c3f404a7-12" x="21.95" y="38.97"/>
<use xlink:href="#img-c3f404a7-12" x="23.96" y="34.36"/>
<use xlink:href="#img-c3f404a7-12" x="25.97" y="29.9"/>
<use xlink:href="#img-c3f404a7-12" x="27.98" y="25.67"/>
<use xlink:href="#img-c3f404a7-12" x="29.99" y="21.73"/>
<use xlink:href="#img-c3f404a7-12" x="32" y="18.16"/>
<use xlink:href="#img-c3f404a7-12" x="34.02" y="15"/>
<use xlink:href="#img-c3f404a7-12" x="36.03" y="12.31"/>
<use xlink:href="#img-c3f404a7-12" x="38.04" y="10.14"/>
<use xlink:href="#img-c3f404a7-12" x="40.05" y="8.52"/>
<use xlink:href="#img-c3f404a7-12" x="42.06" y="7.47"/>
<use xlink:href="#img-c3f404a7-12" x="44.07" y="7.02"/>
<use xlink:href="#img-c3f404a7-12" x="46.08" y="7.17"/>
<use xlink:href="#img-c3f404a7-12" x="48.09" y="7.92"/>
<use xlink:href="#img-c3f404a7-12" x="50.1" y="9.26"/>
<use xlink:href="#img-c3f404a7-12" x="52.11" y="11.16"/>
<use xlink:href="#img-c3f404a7-12" x="54.13" y="13.59"/>
<use xlink:href="#img-c3f404a7-12" x="56.14" y="16.52"/>
<use xlink:href="#img-c3f404a7-12" x="58.15" y="19.9"/>
<use xlink:href="#img-c3f404a7-12" x="60.16" y="23.66"/>
<use xlink:href="#img-c3f404a7-12" x="62.17" y="27.75"/>
<use xlink:href="#img-c3f404a7-12" x="64.18" y="32.11"/>
<use xlink:href="#img-c3f404a7-12" x="66.19" y="36.65"/>
<use xlink:href="#img-c3f404a7-12" x="68.2" y="41.31"/>
<use xlink:href="#img-c3f404a7-12" x="70.21" y="46.01"/>
<use xlink:href="#img-c3f404a7-12" x="72.22" y="50.66"/>
<use xlink:href="#img-c3f404a7-12" x="74.23" y="55.21"/>
<use xlink:href="#img-c3f404a7-12" x="76.25" y="59.56"/>
<use xlink:href="#img-c3f404a7-12" x="78.26" y="63.66"/>
<use xlink:href="#img-c3f404a7-12" x="80.27" y="67.42"/>
<use xlink:href="#img-c3f404a7-12" x="82.28" y="70.79"/>
<use xlink:href="#img-c3f404a7-12" x="84.29" y="73.72"/>
<use xlink:href="#img-c3f404a7-12" x="86.3" y="76.16"/>
<use xlink:href="#img-c3f404a7-12" x="88.31" y="78.06"/>
<use xlink:href="#img-c3f404a7-12" x="90.32" y="79.4"/>
<use xlink:href="#img-c3f404a7-12" x="92.33" y="80.15"/>
<use xlink:href="#img-c3f404a7-12" x="94.34" y="80.3"/>
<use xlink:href="#img-c3f404a7-12" x="96.36" y="79.85"/>
<use xlink:href="#img-c3f404a7-12" x="98.37" y="78.8"/>
<use xlink:href="#img-c3f404a7-12" x="100.38" y="77.18"/>
<use xlink:href="#img-c3f404a7-12" x="102.39" y="75"/>
<use xlink:href="#img-c3f404a7-12" x="104.4" y="72.32"/>
<use xlink:href="#img-c3f404a7-12" x="106.41" y="69.16"/>
<use xlink:href="#img-c3f404a7-12" x="108.42" y="65.58"/>
<use xlink:href="#img-c3f404a7-12" x="110.43" y="61.65"/>
<use xlink:href="#img-c3f404a7-12" x="112.44" y="57.41"/>
<use xlink:href="#img-c3f404a7-12" x="114.45" y="52.96"/>
<use xlink:href="#img-c3f404a7-12" x="116.46" y="48.35"/>
<use xlink:href="#img-c3f404a7-12" x="118.48" y="43.66"/>
</g>
</g>
</g>
</g>
</g>
<g class="guide ylabels" font-size="2.82" font-family="'PT Sans Caption','Helvetica Neue','Helvetica',sans-serif" fill="#6C606B" id="img-c3f404a7-13">
<text x="16.94" y="80.32" text-anchor="end" dy="0.35em">-1.0</text>
<text x="16.94" y="61.99" text-anchor="end" dy="0.35em">-0.5</text>
<text x="16.94" y="43.66" text-anchor="end" dy="0.35em">0.0</text>
<text x="16.94" y="25.33" text-anchor="end" dy="0.35em">0.5</text>
<text x="16.94" y="7" text-anchor="end" dy="0.35em">1.0</text>
</g>
<g font-size="3.88" font-family="'PT Sans','Helvetica Neue','Helvetica',sans-serif" fill="#564A55" stroke="#000000" stroke-opacity="0.000" id="img-c3f404a7-14">
<text x="8.81" y="43.66" text-anchor="end" dy="0.35em">y</text>
</g>
</g>
<defs>
<clipPath id="img-c3f404a7-4">
<path d="M17.94,5 L 147.4 5 147.4 82.32 17.94 82.32" />
</clipPath>
<g id="img-c3f404a7-12">
<circle cx="0" cy="0" r="0.9"/>
</g>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 15 KiB

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,70 @@
% Intro to Weave.jl with Gadfly
% Matti Pastell
% 20th April 2016
# Introduction
This a sample [Julia](http://julialang.org/) noweb 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 and HTML directly (with Pandoc) 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 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=8; fig_height=4}
plot(y = cumsum(randn(1000, 1)), Geom.line)
```
# Whats next
Read the documentation:
- stable: <http://mpastell.github.io/Weave.jl/stable/>
- latest: <http://mpastell.github.io/Weave.jl/latest/>
See other examples in: <https://github.com/mpastell/Weave.jl/tree/master/examples>

Binary file not shown.

View File

@ -0,0 +1,103 @@
% Intro to Weave.jl with Gadfly
% Matti Pastell
% 20th April 2016
# Introduction
This a sample [Julia](http://julialang.org/) noweb 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 and HTML directly (with Pandoc) 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 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)
````
````julia
linspace(0.0,6.283185307179586,50)
````
````julia
plot(x = x, y = sin(x))
````
![](figures/gadfly_md_sample_2_1.pdf)\
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{ASCIIString,ASCIIString} 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.pdf)
# Whats next
Read the documentation:
- stable: <http://mpastell.github.io/Weave.jl/stable/>
- latest: <http://mpastell.github.io/Weave.jl/latest/>
See other examples in: <https://github.com/mpastell/Weave.jl/tree/master/examples>

View File

@ -0,0 +1,309 @@
<!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 - Scientific Reports Using Julia</title>
<meta name="author" content="Matti Pastell">
<meta property="og:url" content="None">
<meta property="og:title" content="Weave.jl - Scientific Reports Using Julia">
<meta property="og:image" content="None/../">
<meta name="apple-mobile-web-app-title" content="Weave.jl - Scientific Reports Using Julia">
<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="../None">
<link rel="icon" type="image/x-icon" href="../None">
<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-54f87043f3.css">
<link rel="stylesheet" href="../assets/stylesheets/palettes-05ab2406df.css">
<link rel="stylesheet" href="//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="palette-primary-indigo palette-accent-blue">
<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-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 - Scientific Reports Using Julia
<span class="version">
</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/master.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="Function index" href="./">
Function index
</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="../chunk_options/#Weave.get_chunk_defaults-Tuple{}"><code>Weave.get_chunk_defaults</code></a></li>
<li><a href="../chunk_options/#Weave.restore_chunk_defaults-Tuple{}"><code>Weave.restore_chunk_defaults</code></a></li>
<li><a href="../chunk_options/#Weave.set_chunk_defaults-Tuple{Any}"><code>Weave.set_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="../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="../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">
</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>
</body>
</html>

View File

@ -0,0 +1,337 @@
<!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 - Scientific Reports Using Julia</title>
<meta name="author" content="Matti Pastell">
<meta property="og:url" content="None">
<meta property="og:title" content="Weave.jl - Scientific Reports Using Julia">
<meta property="og:image" content="None/../">
<meta name="apple-mobile-web-app-title" content="Weave.jl - Scientific Reports Using Julia">
<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="../None">
<link rel="icon" type="image/x-icon" href="../None">
<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-54f87043f3.css">
<link rel="stylesheet" href="../assets/stylesheets/palettes-05ab2406df.css">
<link rel="stylesheet" href="//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="palette-primary-indigo palette-accent-blue">
<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-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 - Scientific Reports Using Julia
<span class="version">
</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/master.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="Function index" href="../function_index/">
Function index
</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 HTML and pdf output requires that you have Pandoc and XeLatex (for pdf) installed.</em></p>
<p>You can Weave the files to your working directory using:</p>
<pre><code>using Weave
#Markdown
weave(Pkg.dir(&quot;Weave&quot;,&quot;examples&quot;,&quot;gadfly_md_sample.jmd&quot;), out_path = :pwd,
doctype = &quot;pandoc&quot;)
#HTML
weave(Pkg.dir(&quot;Weave&quot;,&quot;examples&quot;,&quot;gadfly_md_sample.jmd&quot;), out_path = :pwd,
doctype = &quot;md2html&quot;)
#pdf
weave(Pkg.dir(&quot;Weave&quot;,&quot;examples&quot;,&quot;gadfly_md_sample.jmd&quot;), out_path = :pwd,
doctype = &quot;md2pdf&quot;)
</code></pre>
<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>
</body>
</html>

View File

@ -174,6 +174,61 @@
<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="Function index" href="function_index/">
Function index
</a>
</li>
@ -191,140 +246,43 @@
<p><a id='Intro-1'></a></p>
<h1 id="intro">Intro</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> and, Knitr and Sweave.</p>
<p>You can write your documentation and code in input document using Nowed or Markdown syntax and use <code>weave</code> function to execute to document to capture results and figures.</p>
<p><strong>Current features</strong></p>
<ul>
<li>Noweb or markdown syntax for input documents.</li>
<li>Execute code as terminal or "script" chunks.</li>
<li>Capture PyPlot or Gadfly figures.</li>
<li>
<p>Supports LaTex, Pandoc and Github markdown and reStructuredText output</p>
</li>
<li>
<p><a href=".#Intro-1">Intro</a></p>
</li>
<li><a href=".#Document-syntax-1">Document syntax</a><ul>
<li><a href=".#Noweb-1">Noweb</a></li>
<li><a href=".#Markdown-1">Markdown</a></li>
<li>Capture Gadfly, PyPlot or Winston figures.</li>
<li>Supports LaTex, Pandoc and Github markdown, AsciiDoc and reStructuredText output</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="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=".#Chunk-options-1">Chunk options</a></li>
<li><a href=".#Usage-1">Usage</a><ul>
<li><a href=".#Weave-1">Weave</a></li>
<li><a href=".#Tangle-1">Tangle</a></li>
<li><a href=".#Supported-formats-1">Supported formats</a></li>
<li><a href="function_index/#Function-index-1">Function index</a></li>
<li><a href="getting_started/#Getting-started-1">Getting started</a></li>
<li><a href=".#Intro-1">Intro</a><ul>
<li><a href=".#Contents-1">Contents</a></li>
</ul>
</li>
<li><a href=".#Index-1">Index</a></li>
<li><a href="publish/#Publishing-scripts-1">Publishing scripts</a><ul>
<li><a href="publish/#Other-mark-ups-with-scripts-1">Other mark ups with scripts</a></li>
</ul>
<p><a id='Document-syntax-1'></a></p>
<h1 id="document-syntax">Document syntax</h1>
<p>Weave uses noweb or markdown syntax for defining the code chunks and documentation chunks.</p>
<p><a id='Noweb-1'></a></p>
<h2 id="noweb">Noweb</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 for options below.</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-1'></a></p>
<h2 id="markdown">Markdown</h2>
<p>Markdown code chunks are defined using fenced code blocks. <a href="https://github.com/mpastell/Weave.jl/blob/master/examples/gadfly_sample.jmd">See sample document:</a></p>
<p><a id='Chunk-options-1'></a></p>
<h1 id="chunk-options">Chunk options</h1>
<p>I've tried to follow <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>
<pre><code class="julia">&lt;&lt;fig_width=5; echo=false &gt;&gt;=
using Gadfly
x = linspace(0, 2π, 200)
plot(x=x, y = sin(x), Geom.line)
@
</code></pre>
<p>Weave currently supports the following chunk options with the following defaults:</p>
<p><strong>Options for code</strong></p>
<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>
<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-1">Noweb</a></li>
<li><a href="usage/#Markdown-1">Markdown</a></li>
</ul>
<p><strong>Options for figures</strong></p>
<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='Usage-1'></a></p>
<h1 id="usage">Usage</h1>
<p><a id='Weave-1'></a></p>
<h2 id="weave">Weave</h2>
<p>Run from julia using Gadfly for plots:</p>
<pre><code class="julia">using Weave
weave(Pkg.dir(&quot;Weave&quot;,&quot;examples&quot;,&quot;gadfly_sample.mdw&quot;))
</code></pre>
<p>Using PyPlot:</p>
<pre><code class="julia">weave(Pkg.dir(&quot;Weave&quot;,&quot;examples&quot;,&quot;julia_sample.mdw&quot;), plotlib=&quot;PyPlot&quot;)
</code></pre>
<p><a id='Weave.weave-Tuple{Any}' href='#Weave.weave-Tuple{Any}'>#</a>
<strong><code>Weave.weave</code></strong> &mdash; <em>Method</em>.</p>
<hr />
<p>weave(source ; doctype = "pandoc", plotlib="Gadfly", informat="noweb", out_path=:doc, fig_path = "figures", fig_ext = nothing)</p>
<p>Weave an input document to output file.</p>
<ul>
<li><code>doctype</code>: see <code>list_out_formats()</code></li>
<li><code>plotlib</code>: <code>"PyPlot"</code>, <code>"Gadfly"</code>, or <code>"Winston"</code></li>
<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>: Path as a AbstractString e.g <code>"/home/mpastell/weaveout"</code></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>
</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='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>
<hr />
<p>tangle(source ; out_path=:doc, informat="noweb")</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>: Path as a AbstractString e.g <code>"/home/mpastell/weaveout"</code></li>
</ul>
<p><a id='Supported-formats-1'></a></p>
<h2 id="supported-formats">Supported formats</h2>
<p>You can get a list of supported output formats:</p>
<pre><code>julia&gt; list_out_formats()
pandoc: Pandoc markdown
rst: reStructuredText and Sphinx
texminted: Latex using minted for highlighting
github: Github markdown
asciidoc: AsciiDoc
tex: Latex with custom code environments
</code></pre>
<p><a id='Index-1'></a></p>
<h1 id="index">Index</h1>
<ul>
<li><a href=".#Weave.tangle-Tuple{Any}"><code>Weave.tangle</code></a></li>
<li><a href=".#Weave.weave-Tuple{Any}"><code>Weave.weave</code></a></li>
</li>
</ul>
<aside class="copyright" role="note">
@ -341,6 +299,31 @@ tex: Latex with custom code environments
<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>
@ -360,8 +343,6 @@ tex: Latex with custom code environments
</script>
<script src="./assets/javascripts/application-997097ee0c.js"></script>
<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script src="./assets/mathjaxhelper.js"></script>

File diff suppressed because one or more lines are too long

342
stable/publish/index.html Normal file
View File

@ -0,0 +1,342 @@
<!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 - Scientific Reports Using Julia</title>
<meta name="author" content="Matti Pastell">
<meta property="og:url" content="None">
<meta property="og:title" content="Weave.jl - Scientific Reports Using Julia">
<meta property="og:image" content="None/../">
<meta name="apple-mobile-web-app-title" content="Weave.jl - Scientific Reports Using Julia">
<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="../None">
<link rel="icon" type="image/x-icon" href="../None">
<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-54f87043f3.css">
<link rel="stylesheet" href="../assets/stylesheets/palettes-05ab2406df.css">
<link rel="stylesheet" href="//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="palette-primary-indigo palette-accent-blue">
<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-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 - Scientific Reports Using Julia
<span class="version">
</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/master.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="Other mark ups with scripts" href="#other-mark-ups-with-scripts">
Other mark ups with scripts
</a>
</li>
</ul>
</li>
<li>
<a class="" title="Chunk options" href="../chunk_options/">
Chunk options
</a>
</li>
<li>
<a class="" title="Function index" href="../function_index/">
Function index
</a>
</li>
</ul>
</div>
</div>
</div>
</nav>
</div>
<article class="article">
<div class="wrapper">
<p><a id='Publishing-scripts-1'></a></p>
<h1 id="publishing-scripts">Publishing scripts</h1>
<p>You can also also publish html and pdf documents from Julia scripts with a specific format. Producing HTML and pdf output requires that you have Pandoc and XeLatex (for pdf) installed and in your path.</p>
<p>These scripts can be executed normally using Julia or published with Weave. Documentation is written in markdown in lines starting with <code>#'</code>, <code>#%%</code> or <code># %%</code> , and code is executed and results are included in the published document.</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>All lines that are not documentation are treated as code. You can set chunk options using lines starting with <code>#+</code>, <code>#%%</code> or <code># %%</code> just before code e.g. <code>#+ term=True, caption='Fancy plots.'</code>. See the example below for the markup.</p>
<p>The scripts can be published using the <code>pypublish</code> scipts:</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>
<pre><code>weave(&quot;FIR_design.jl&quot;)
weave(&quot;FIR_design.jl&quot;, docformat = &quot;md2pdf&quot;)
</code></pre>
<p><a id='Other-mark-ups-with-scripts-1'></a></p>
<h2 id="other-mark-ups-with-scripts">Other mark ups with scripts</h2>
<p>You can also use any Weave supported format in the comments and set the output format as you would for noweb and markdown inputs. e.g for LaTeX you can use:</p>
<pre><code>weave(&quot;latex_doc.jl&quot;, docformat = &quot;texminted&quot;)
</code></pre>
<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>
</body>
</html>

View File

@ -4,7 +4,47 @@
<url>
<loc>None/</loc>
<lastmod>2016-04-19</lastmod>
<lastmod>2016-04-24</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None/getting_started/</loc>
<lastmod>2016-04-24</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None/usage/</loc>
<lastmod>2016-04-24</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None/publish/</loc>
<lastmod>2016-04-24</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None/chunk_options/</loc>
<lastmod>2016-04-24</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None/function_index/</loc>
<lastmod>2016-04-24</lastmod>
<changefreq>daily</changefreq>
</url>

461
stable/usage/index.html Normal file
View File

@ -0,0 +1,461 @@
<!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 - Scientific Reports Using Julia</title>
<meta name="author" content="Matti Pastell">
<meta property="og:url" content="None">
<meta property="og:title" content="Weave.jl - Scientific Reports Using Julia">
<meta property="og:image" content="None/../">
<meta name="apple-mobile-web-app-title" content="Weave.jl - Scientific Reports Using Julia">
<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="../None">
<link rel="icon" type="image/x-icon" href="../None">
<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-54f87043f3.css">
<link rel="stylesheet" href="../assets/stylesheets/palettes-05ab2406df.css">
<link rel="stylesheet" href="//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="palette-primary-indigo palette-accent-blue">
<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-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 - Scientific Reports Using Julia
<span class="version">
</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/master.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" href="#noweb">
Noweb
</a>
</li>
<li class="anchor">
<a title="Markdown" href="#markdown">
Markdown
</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="Function index" href="../function_index/">
Function index
</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 or Markdown 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>
<pre><code class="julia">using Weave
weave(Pkg.dir(&quot;Weave&quot;,&quot;examples&quot;,&quot;gadfly_sample.mdw&quot;), out_path = :pwd)
</code></pre>
<p>Using PyPlot:</p>
<pre><code class="julia">weave(Pkg.dir(&quot;Weave&quot;,&quot;examples&quot;,&quot;julia_sample.mdw&quot;), plotlib=&quot;PyPlot&quot;, out_path = :pwd)
</code></pre>
<p><a id='Weave.weave-Tuple{Any}' href='#Weave.weave-Tuple{Any}'>#</a>
<strong><code>Weave.weave</code></strong> &mdash; <em>Method</em>.</p>
<hr />
<p><code>function weave(source ; doctype = :auto, plotlib="Gadfly", informat=:auto, out_path=:doc, fig_path = "figures", fig_ext = nothing, cache_path = "cache", cache=:off)</code></p>
<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>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>
</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>
<pre><code>$ ./weave.jl
usage: weave.jl [--doctype DOCTYPE] [--plotlib PLOTLIB]
[--informat INFORMAT] [--out_path OUT_PATH]
[--fig_path FIG_PATH] [--fig_ext FIG_EXT] source...
</code></pre>
<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>
<hr />
<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> or filename as string e.g. ~/outpath/outfile.jl.</li>
</ul>
<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>
<pre><code class="julia">ext == &quot;.jl&quot; &amp;&amp; return &quot;md2html&quot;
contains(ext, &quot;.md&quot;) &amp;&amp; return &quot;md2html&quot;
contains(ext, &quot;.rst&quot;) &amp;&amp; return &quot;rst&quot;
contains(ext, &quot;.tex&quot;) &amp;&amp; return &quot;texminted&quot;
contains(ext, &quot;.txt&quot;) &amp;&amp; return &quot;asciidoc&quot;
return &quot;pandoc&quot;
</code></pre>
<p>You can get a list of supported output formats:</p>
<pre><code>julia&gt; list_out_formats()
pandoc: Pandoc markdown
rst: reStructuredText and Sphinx
texminted: Latex using minted for highlighting
github: Github markdown
md2html: Markdown to HTML (requires Pandoc)
md2pdf: Markdown to pdf (requires Pandoc and xelatex)
asciidoc: AsciiDoc
tex: Latex with custom code environments
</code></pre>
<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>
<hr />
<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. 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>
<pre><code>ext == &quot;.jl&quot; &amp;&amp; return &quot;script&quot;
ext == &quot;.jmd&quot; &amp;&amp; return &quot;markdown&quot;
return &quot;noweb&quot;
</code></pre>
<p><a id='Noweb-1'></a></p>
<h2 id="noweb">Noweb</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 for options below.</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-1'></a></p>
<h2 id="markdown">Markdown</h2>
<p>Markdown code chunks are defined using fenced code blocks. <a href="https://github.com/mpastell/Weave.jl/blob/master/examples/gadfly_sample.jmd">See sample document:</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="../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>
</body>
</html>