Browse Source

docs

pull/120/head
Fredrik Ekre 4 years ago
parent
commit
54bc6119c6
  1. 17
      docs/src/outputformats.md
  2. 5
      src/Literate.jl

17
docs/src/outputformats.md

@ -80,16 +80,17 @@ Literate.markdown @@ -80,16 +80,17 @@ Literate.markdown
Literate can output markdown in different flavors. The flavor is specified using the
`flavor` keyword argument. The following flavors are currently supported:
- `flavor = Literate.DocumenterFlavor()` this is the default flavor and the output is
- `flavor = Literate.DocumenterFlavor()`: this is the default flavor and the output is
meant to be used as input to [Documenter.jl](https://github.com/JuliaDocs/Documenter.jl).
- `flavor = Literate.FranklinFlavor()` this outputs markdown meant to be used as input
- `flavor = Literate.FranklinFlavor()`: this outputs markdown meant to be used as input
to [Franklin.jl](https://franklinjl.org/).
## [**4.2.** Notebook output](@id Notebook-output)
Notebook output is generated by [`Literate.notebook`](@ref). The (default) notebook output
of the source snippet can be seen here: [notebook.ipynb](generated/notebook.ipynb).
Notebook output is generated by [`Literate.notebook`](@ref). The Jupyter notebook output
of the source snippet can be seen here: [notebook.ipynb](generated/notebook.ipynb),
and the Pluto notebook output can be seen here: [notebook.jl](generated/notebook.jl).
We note that lines starting with `# ` are placed in markdown cells,
and the code lines have been placed in code cells. By default the notebook
@ -103,6 +104,14 @@ output of [`Literate.notebook`](@ref). @@ -103,6 +104,14 @@ output of [`Literate.notebook`](@ref).
Literate.notebook
```
### Notebook flavors
Literate can output both Jupyter notebooks and Pluto notebooks. The flavor is specified
using the `flavor` keyword argument:
- `flavor = Literate.JupyterFlavor()` (default)
- `flavor = Literate.PlutoFlavor()`
### Notebook metadata
Jupyter notebook cells (both code cells and markdown cells) can contain metadata. This is enabled

5
src/Literate.jl

@ -350,9 +350,10 @@ Available options: @@ -350,9 +350,10 @@ Available options:
`This file was generated with Literate.jl ...` to the bottom of the page. If you find
Literate.jl useful then feel free to keep this.
- `keep_comments` (default: `false`): When `true`, keeps markdown lines as comments in the
output script. Only applicable for `Literate.script`.
output script. Only applicable for [`Literate.script`](@ref)
- `execute` (default: `true` for notebook, `false` for markdown): Whether to execute and
capture the output. Only applicable for `Literate.notebook` and `Literate.markdown`.
capture the output. Only applicable for [`Literate.notebook`](@ref) and
[`Literate.markdown`](@ref).
- `codefence` (default: `````"````@example \$(name)" => "````"````` for `DocumenterFlavor()`
and `````"````julia" => "````"````` otherwise): Pair containing opening and closing
code fence for wrapping code blocks.

Loading…
Cancel
Save