From 9ad7493e1d02593bf4cd99ce187c7d8d4b766ee8 Mon Sep 17 00:00:00 2001 From: Matti Pastell Date: Wed, 20 Apr 2016 12:26:22 +0300 Subject: [PATCH] Updated doc structure --- doc/mkdocs.yml | 14 +++++++++----- doc/src/index.md | 36 ++++++++++++++++++------------------ 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/doc/mkdocs.yml b/doc/mkdocs.yml index 60203fe..05dc18d 100644 --- a/doc/mkdocs.yml +++ b/doc/mkdocs.yml @@ -3,21 +3,25 @@ site_author: Matti Pastell copyright: Matti Pastell 2016 repo_url: https://github.com/mpastell/Weave.jl -#theme: material +theme: material +extra: + palette: + primary: 'indigo' + accent: 'blue' extra_css: - assets/Documenter.css -extra_javascript: - - https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML - - assets/mathjaxhelper.js +#extra_javascript: +# - https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML +# - assets/mathjaxhelper.js markdown_extensions: - extra - tables - fenced_code - - mdx_math +# - mdx_math docs_dir: 'build' diff --git a/doc/src/index.md b/doc/src/index.md index 7beeec2..7be4411 100644 --- a/doc/src/index.md +++ b/doc/src/index.md @@ -14,36 +14,37 @@ You can write your documentation and code in input document using Noweb or Markd * Capture PyPlot or Gadfly figures. * Supports LaTex, Pandoc and Github markdown and reStructuredText output + +## Contents + {contents} -# Document syntax +## Document syntax Weave uses noweb or markdown syntax for defining the code chunks and documentation chunks. -## Noweb +### Noweb -### Code chunks +#### Code chunks start with a line marked with `<<>>=` or `<>=` and end with line marked with `@`. The code between the start and end markers is executed and the output is captured to the output document. See for options below. - - -### Documentation chunks +#### Documentation chunks Are the rest of the document (between `@` and `<<>>=` lines and the first chunk be default) and can be written with several different markup languages. [Sample document]( https://github.com/mpastell/Weave.jl/blob/master/examples/julia_sample.mdw) -## Markdown +### Markdown Markdown code chunks are defined using fenced code blocks. [See sample document:](https://github.com/mpastell/Weave.jl/blob/master/examples/gadfly_sample.jmd) -# Chunk options +## Chunk options -I've tried to follow [Knitr](http://yihui.name/knitr/options)'s naming for chunk options, but not all options are implemented. +I've mostly followed [Knitr](http://yihui.name/knitr/options)'s naming for chunk options, but not all options are implemented. -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: +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: ```julia <>= @@ -55,8 +56,7 @@ plot(x=x, y = sin(x), Geom.line) Weave currently supports the following chunk options with the following defaults: - -**Options for code** +### Options for code * `echo = true`. Echo the code in the output document. If `false` the source code will be hidden. * `results = "markup"`. 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 wan’t to e.g. create tables from code chunks. @@ -68,7 +68,7 @@ Weave currently supports the following chunk options with the following defaults * `cache = false`. Cache results, depends on `cache` parameter on `weave` function. * `hold = false`. Hold all results until the end of the chunk. -**Options for figures** +### Options for figures * `fig_width`. Figure width defined in markup, default depends on the output format. * `out_width`. Width of saved figure. @@ -81,9 +81,9 @@ Weave currently supports the following chunk options with the following defaults * `fig_env="figure"`. Figure environment in Latex. -# Usage +## Usage -## Weave +### Weave Run from julia using Gadfly for plots: @@ -101,7 +101,7 @@ weave(Pkg.dir("Weave","examples","julia_sample.mdw"), plotlib="PyPlot") {docs} weave(source) -## Tangle +### Tangle Tangling extracts the code from document: @@ -110,7 +110,7 @@ Tangling extracts the code from document: -## Get supported formats +### Get supported formats You can get a list of supported output formats: @@ -151,6 +151,6 @@ Weave.set_chunk_defaults(Dict{Symbol, Any}( get_chunk_defaults() restore_chunk_defaults() -# Function index +## Function index {index}