From 54bc6119c6636b6caef0323e7ff256860675337a Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Mon, 1 Nov 2021 13:32:13 +0100 Subject: [PATCH] docs --- docs/src/outputformats.md | 17 +++++++++++++---- src/Literate.jl | 5 +++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/docs/src/outputformats.md b/docs/src/outputformats.md index 8716620..8021807 100644 --- a/docs/src/outputformats.md +++ b/docs/src/outputformats.md @@ -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). 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 diff --git a/src/Literate.jl b/src/Literate.jl index aa728fc..9327a95 100644 --- a/src/Literate.jl +++ b/src/Literate.jl @@ -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.