Weave.jl/README.md

105 lines
4.2 KiB
Markdown
Raw Permalink Normal View History

2016-12-23 09:54:48 +01:00
# Weave
2020-06-13 21:17:34 +02:00
![CI](https://github.com/JunoLab/Weave.jl/workflows/CI/badge.svg)
2020-06-13 21:15:45 +02:00
[![codecov](https://codecov.io/gh/JunoLab/Weave.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JunoLab/Weave.jl)
[![](https://img.shields.io/badge/docs-stable-blue.svg)](http://weavejl.mpastell.com/stable/)
[![](https://img.shields.io/badge/docs-dev-blue.svg)](http://weavejl.mpastell.com/dev/)
2017-03-22 13:56:57 +01:00
[![](http://joss.theoj.org/papers/10.21105/joss.00204/status.svg)](http://dx.doi.org/10.21105/joss.00204)
2016-12-23 09:54:48 +01:00
2020-06-13 21:19:20 +02:00
Weave is a scientific report generator/literate programming tool for the [Julia programming language](https://julialang.org/).
2020-04-01 12:04:55 +02:00
It resembles
[Pweave](http://mpastell.com/pweave),
[knitr](https://yihui.org/knitr/),
[R Markdown](https://rmarkdown.rstudio.com/),
and [Sweave](https://stat.ethz.ch/R-manual/R-patched/library/utils/doc/Sweave.pdf).
2016-12-23 09:54:48 +01:00
2020-04-01 12:04:55 +02:00
You can write your documentation and code in input document using Markdown, Noweb or ordinal Julia script syntax,
and then use `weave` function to execute code and generate an output document while capturing results and figures.
2016-12-23 09:54:48 +01:00
**Current features**
2020-04-01 12:04:55 +02:00
- Publish markdown directly to HTML and PDF using Julia or [Pandoc](https://pandoc.org/MANUAL.html)
- Execute code as in terminal or in a unit of code chunk
- Capture [Plots.jl](https://github.com/JuliaPlots/Plots.jl) or [Gadfly.jl](https://github.com/GiovineItalia/Gadfly.jl) figures
- Supports various input format: Markdown, [Noweb](https://www.cs.tufts.edu/~nr/noweb/), [Jupyter Notebook](https://jupyter.org/), and ordinal Julia script
- Conversions between those input formats
- Supports various output document formats: HTML, PDF, GitHub markdown, Jupyter Notebook, MultiMarkdown, Asciidoc and reStructuredText
- Simple caching of results
2017-03-30 17:25:41 +02:00
**Citing Weave:** *Pastell, Matti. 2017. Weave.jl: Scientific Reports Using Julia. The Journal of Open Source Software. http://dx.doi.org/10.21105/joss.00204*
2020-03-06 12:52:09 +01:00
![Weave in Juno demo](https://user-images.githubusercontent.com/40514306/76081328-32f41900-5fec-11ea-958a-375f77f642a2.png)
2017-03-14 17:08:15 +01:00
2017-03-06 16:43:12 +01:00
## Installation
You can install the latest release using Julia package manager:
```julia
2018-08-13 14:30:06 +02:00
using Pkg
2017-03-06 16:43:12 +01:00
Pkg.add("Weave")
```
2016-12-23 09:54:48 +01:00
2020-05-18 15:59:18 +02:00
## Usage
2016-12-23 09:54:48 +01:00
```julia
using Weave
2020-05-18 15:59:18 +02:00
# add depencies for the example
using Pkg; Pkg.add(["Plots", "DSP"])
2020-05-23 12:42:19 +02:00
filename = normpath(Weave.EXAMPLE_FOLDER, "FIR_design.jmd")
weave(filename, out_path = :pwd)
2016-12-23 09:54:48 +01:00
```
2018-08-13 14:30:06 +02:00
If you have LaTeX installed you can also weave directly to pdf.
2016-12-23 09:54:48 +01:00
```julia
2020-05-23 12:42:19 +02:00
filename = normpath(Weave.EXAMPLE_FOLDER, "FIR_design.jmd")
weave(filename, out_path = :pwd, doctype = "md2pdf")
2016-12-23 09:54:48 +01:00
```
2020-05-23 12:42:19 +02:00
NOTE: `Weave.EXAMPLE_FOLDER` just points to [`examples` directory](./examples).
2020-05-18 15:59:18 +02:00
2016-12-23 09:54:48 +01:00
## Documentation
Documenter.jl with MKDocs generated documentation:
[![](https://img.shields.io/badge/docs-stable-blue.svg)](http://weavejl.mpastell.com/stable/)
[![](https://img.shields.io/badge/docs-dev-blue.svg)](http://weavejl.mpastell.com/dev/)
2016-12-23 09:54:48 +01:00
2020-05-18 15:59:18 +02:00
2016-12-23 09:54:48 +01:00
## Editor support
2019-03-04 14:42:16 +01:00
Install [language-weave](https://atom.io/packages/language-weave) to add Weave support to Juno.
It allows running code from Weave documents with usual keybindings and allows preview of
html and pdf output.
2016-12-23 09:54:48 +01:00
2019-06-10 20:23:01 +02:00
The [Julia extension for Visual Studio Code](https://www.julia-vscode.org/)
adds Weave support to [Visual Studio Code](https://code.visualstudio.com/).
2020-05-18 15:59:18 +02:00
2016-12-23 09:54:48 +01:00
## Contributing
2020-04-01 12:04:55 +02:00
You can contribute to this package by opening issues on GitHub or implementing things yourself and making a pull request.
We'd also appreciate more example documents written using Weave.
2016-12-23 09:54:48 +01:00
2020-05-18 15:59:18 +02:00
2016-12-23 09:54:48 +01:00
## Contributors
2020-04-01 12:04:55 +02:00
You can see the list of contributors on GitHub: https://github.com/JunoLab/Weave.jl/graphs/contributors .
Thanks for the important additions, fixes and comments.
2019-03-04 14:42:16 +01:00
2020-05-18 15:59:18 +02:00
2019-03-04 14:42:16 +01:00
## Example projects using Weave
- [DiffEqTutorials.jl](https://github.com/JuliaDiffEq/DiffEqTutorials.jl) uses Weave to output tutorials (`.jmd` documents) to html, pdf and Jupyter notebooks.
- [TuringTutorials](https://github.com/TuringLang/TuringTutorials) uses Weave to convert notebooks to html.
2023-01-18 15:52:44 +01:00
## Related packages
- [Literate.jl](https://github.com/fredrikekre/Literate.jl) can be used to generate Markdown and Jupyter notebooks directly from Julia source files with markdown in comments.
2024-04-16 12:43:11 +02:00
- [Quarto](https://quarto.org) can generate Jupyter notebooks, HTML, or PDF directly from a Markdown format containing Julia code blocks, and also works with R and Python.