Welcome to the documentation for Literate -- a simplistic package
for [Literate Programming](https://en.wikipedia.org/wiki/Literate_programming).
@ -13,11 +13,13 @@ an option to "clean" the source from all metadata, and produce a pure Julia scri
@@ -13,11 +13,13 @@ an option to "clean" the source from all metadata, and produce a pure Julia scri
The main design goal is simplicity. It should be simple to use, and the syntax should
be simple. In short, all you have to do is to write a commented julia script!
The public interface consists mainly of three functions, all of which take the same script file
The public interface consists of three functions, all of which take the same script file
as input, but generate different output:
- [`Literate.markdown`](@ref): generates a markdown file
- [`Literate.notebook`](@ref): generates an (optionally executed) notebook
- [`Literate.script`](@ref): generates a plain script file, removing all metadata
- [`Literate.markdown`](@ref) generates a markdown file. Code snippets can be executed and
the results included in the output.
- [`Literate.notebook`](@ref) generates a notebook. Code snippets can be executed and
the results included in the output.
- [`Literate.script`](@ref) generates a plain script file scrubbed from all metadata
@ -29,8 +29,32 @@ an `@meta` block have been added, that sets the `EditURL` variable. This is used
@@ -29,8 +29,32 @@ an `@meta` block have been added, that sets the `EditURL` variable. This is used
by Documenter to redirect the "Edit on GitHub" link for the page,
see [Interaction with Documenter](@ref).
See the section about [Configuration](@ref) for how to configure the behavior and resulting
output of [`Literate.markdown`](@ref).
It possible to configure `Literate.markdown` to also evaluate code snippets, capture the
result and include it in the output, by passing `execute=true` as a keyword argument.
The result of the first code-block in the example above would then become
````markdown
```julia
x = 1//3
```
```
1//3
```
````
In this example the output is just plain text. However, if the resulting value of the code
block can be displayed as an image (png or jpeg) Literate will include the image
representation of the output.
!!! note
Since Documenter executes and captures results of `@example` block it is not necessary
to use `execute=true` for markdown output that is meant to be used as input to
Documenter.
!!! compat "Literate 2.3"
Code execution of markdown output requires at least Literate version 2.3.
See the section about [Configuration](@ref) for more information about how to configure the
behavior and resulting output of [`Literate.markdown`](@ref).
edit_commit="master"# TODO: Make this configurable like Documenter?
deploy_branch="gh-pages"# TODO: Make this configurable like Documenter?
@ -288,8 +288,8 @@ See the manual section about [Configuration](@ref) for more information.
@@ -288,8 +288,8 @@ See the manual section about [Configuration](@ref) for more information.
|`credit`|Booleanforcontrollingtheadditionof`This file was generated with Literate.jl ...`tothebottomofthepage.IfyoufindLiterate.jlusefulthenfeelfreetokeepthis.|`true`||
@ -368,7 +368,7 @@ of possible configuration with `config` and other keyword arguments.
@@ -368,7 +368,7 @@ of possible configuration with `config` and other keyword arguments.