Weave.jl/README.md

84 lines
2.5 KiB
Markdown
Raw Normal View History

2014-12-01 21:41:12 +01:00
# JuliaReport
2014-12-06 23:30:37 +01:00
[![Build Status](https://travis-ci.org/mpastell/JuliaReport.jl.svg?branch=master)](https://travis-ci.org/mpastell/JuliaReport.jl)[![Coverage Status](https://img.shields.io/coveralls/mpastell/JuliaReport.jl.svg)](https://coveralls.io/r/mpastell/JuliaReport.jl?branch=master)
2014-12-04 16:54:56 +01:00
2014-12-01 21:41:12 +01:00
JuliaReport is a scientific report generator/literate programming tool
2014-12-02 15:59:26 +01:00
for Julia. It resembles [Pweave](http://mpastell.com/pweave) and, Knitr
and Sweave.
2014-12-01 21:41:12 +01:00
**Current features**
* Noweb syntax for documents.
* Execute code as terminal or "script" chunks.
2014-12-04 16:54:56 +01:00
* Capture PyPlot, Gadfly or Winston figures.
2014-12-02 15:59:26 +01:00
* Supports latex and pandoc markdown output
2014-12-01 21:41:12 +01:00
**Not implemented**
* Script reader
* Inline code
* Caching
## Chunk options
2014-12-04 21:10:24 +01:00
I've tried to follow [Knitr](http://yihui.name/knitr/options)'s naming for chunk options, but not all options are implemented.
You can see [`src/config.jl`](https://github.com/mpastell/JuliaReport.jl/blob/master/src/config.jl) for the current situation.
2014-12-01 21:41:12 +01:00
2014-12-04 21:10:24 +01:00
Options are separated using ";" and need to be valid Julia expressions. e.g.
2014-12-02 09:55:32 +01:00
2014-12-04 21:10:24 +01:00
<<term=true; fig_width=6; fig_height=4>>=
2014-12-01 21:41:12 +01:00
2014-12-05 22:33:54 +01:00
## File formats
You can get a list of supported output formats:
````julia
julia> list_out_formats()
pandoc: Pandoc markdown
rst: reStructuredText and Sphinx
texminted: Latex using minted for highlighting
github: Github markdown
tex: Latex with custom code environments
````
2014-12-01 21:41:12 +01:00
## Usage
Run from julia:
2014-12-05 22:33:54 +01:00
````julia
using JuliaReport
weave(Pkg.dir("JuliaReport","examples","julia_sample.mdw")
````
2014-12-02 09:55:32 +01:00
2014-12-04 16:54:56 +01:00
Using Winston for plots (Julia 0.3 only):
2014-12-02 09:55:32 +01:00
2014-12-05 22:33:54 +01:00
````julia
weave(Pkg.dir("JuliaReport","examples","winston_sample.mdw"),
plotlib="Winston", doctype="pandoc")
````
2014-12-02 09:55:32 +01:00
2014-12-04 16:54:56 +01:00
Using Gadfly (Julia 0.3 only):
2014-12-05 22:33:54 +01:00
````julia
weave(Pkg.dir("JuliaReport","examples","gadfly_sample.mdw"), plotlib="Gadfly")
````
2014-12-04 16:54:56 +01:00
2014-12-05 17:58:15 +01:00
The signature of weave functions is:
2014-12-02 09:55:32 +01:00
2014-12-05 22:33:54 +01:00
````julia
2014-12-06 15:40:50 +01:00
function weave(source ; doctype = "pandoc",
plotlib="PyPlot", informat="noweb", fig_path = "figures", fig_ext = nothing)
2014-12-05 22:33:54 +01:00
````
2014-12-05 17:58:15 +01:00
**Note:** Run JuliaReport from terminal and not using IJulia, Juno or ESS, they tend to mess with capturing output.
## Contributing
I will probably add new features to JuliaReport when I need them myself or if they are requested and not too difficult to implement. You can contribute by opening issues on Github or implementing things yourself and making a pull request. I'd also appreciate example documents written using JuliaReport to add to examples.
## Contributors
Douglas Bates has contributed a number of important fixes and comments.