Coder Social home page Coder Social logo

weave.jl's Introduction

Weave

Build StatusCoverage Status

Weave is a scientific report generator/literate programming tool for Julia. It resembles Pweave and, Knitr and Sweave.

Current features

  • Noweb or markdown syntax for input documents.
  • Execute code as terminal or "script" chunks.
  • Capture PyPlot, Gadfly or Winston figures.
  • Supports LaTex, Pandoc and Github markdown and reStructuredText output

Chunk options

I've tried to follow Knitr's naming for chunk options, but not all options are implemented. You can see src/config.jl for the current situation.

Options are separated using ";" and need to be valid Julia expressions. e.g.

<<term=true; fig_width=6; fig_height=4>>=

File formats

You can get a list of supported output formats:

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

Usage

Run from julia:

using Weave
weave(Pkg.dir("Weave","examples","julia_sample.mdw")

Using Winston for plots (Julia 0.3 only):

weave(Pkg.dir("Weave","examples","winston_sample.mdw"),
plotlib="Winston", doctype="pandoc")

Using Gadfly (Julia 0.3 only):

weave(Pkg.dir("Weave","examples","gadfly_sample.mdw"), plotlib="Gadfly")

The signature of weave functions is:

function weave(source ; doctype = "pandoc", plotlib="Gadfly", informat="noweb", out_path=:doc, fig_path = "figures", fig_ext = nothing)
  • doctype: see list_out_formats()
  • plotlib: "PyPlot", "Gadfly", or "Winston"
  • informat: "noweb" of "markdown"
  • out_path: Path where the output is generated:
    • :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.

Note: Run Weave from terminal and not using IJulia, Juno or ESS, they tend to mess with capturing output.

Contributing

I will probably add new features to Weave 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 Weave to add to examples.

Contributors

Douglas Bates has contributed a number of important fixes and comments.

weave.jl's People

Contributors

dmbates avatar mpastell avatar wildart avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.