API
All additonal packages used in tests or docs need to be recorded in tests/Project.toml
resp. docs/Project.toml
, preferably with a [compat] entry.
Documentation
ExampleJuggler.@docmodules
— Macro@docmodules(example_dir, modules, kwargs...)
Generate markdown files and plots for use with documenter from list of Julia modules. Wrapper macro for docmodules
.
ExampleJuggler.@docscripts
— Macro@docscripts(example_dir, modules, kwargs...)
Generate markdown files and plots for use with documenter from list of Julia modules. Wrapper macro for docmodules
.
ExampleJuggler.docplutonotebooks
— Functiondocplutonotebooks(example_dir, notebooks, kwargs...)
Parameters:
notebooks
: vector of pathnames or pairs of pathnames and strings pointing to notebooks to be tested.
Keyword arguments:
pluto_project
: if notnothing
, this is passed viaENV["PLUTO_PROJECT"]
to the notebooks with the possibility to activate it. By default it has the value ofBase.active_project()
which in practice is the environmentruntests.jl
is running in. As a consequence, if this default is kept, it is necessary to have all package dependencies of the notebooks in the package environment.iframe
: boolean (default: false).- If
true
, html files are produced from the notebooks via PlutoSliderServer.jl, similar to Pluto's html export. For documenter, a markdown page is created which contains statements to show the notebook html in an iframe. The advantage of this method is that active javascript content is shown. The disadvantage is weak integration into documenter. Prerequisite isimport PlutoSliderServer
indocs/make.jl
. - If false, Documenter markdown files are ceated via PlutoStaticHTML.jl. These integrate well with Documenter, but are (as of now) unable to show active javascript content. Graphics is best prepared with CairoMakie. Prerequisite is
import PlutoStaticHTML
indocs/make.jl
.
- If
distributed
: Use parallel evaluation wheniframe==false
append_build_context
: pass this to PlutoStaticHTML.OutputOptions. Possibly needed when running the notebook in external environment.source_prefix
: Path prefix to the notebooks on github (for generating download links) Default: "https://github.com/j-fu/ExampleJuggler.jl/blob/main/examples".iframe_height
: Height of the iframe generated. Default: "500px".
Return value: Vector of pairs of pathnames and strings pointing to generated markdown files for use in Documenter.makedocs()
ExampleJuggler.@docplutonotebooks
— Macro@docplutonotebooks(example_dir, notebooklist, kwargs...)
Macro wrapper for docplutonotebooks
. Just for aestethic reasons, as other parts of the API have to be macros.
ExampleJuggler.cleanexamples
— Functioncleanexamples()
Clean intermediate files from example documentation.
ExampleJuggler.verbose!
— Functionverbose(true_or_false)
Set verbosity
Testing
ExampleJuggler.@testmodules
— Macro@testmodules(example_dir,modules, kwargs...)
Test several scripts defining modules via @testmodule
.
ExampleJuggler.@testscripts
— Macro@testscripts(example_dir, scripts)
Run scripts in the context of the calling module via @testscript
ExampleJuggler.testplutonotebooks
— Function testplutonotebooks(example_dir, notebooks; kwargs...)
Test pluto notebooks as notebooks in a pluto session which means that the notebook code is run in an extra process. Implemented in an extension triggered by using Pluto
.
The method tracks Test.@test
statements in notebook cells via testing errors of failed cells. The method does not invoke eventual runteststs()
methods in the notebooks.
Parameters:
example_dir
: subdirectory with examplesnotebooks
: vector of pathnames of notebooks to be tested.
Keyword arguments:
pluto_project
: if notnothing
, this is passed viaENV["PLUTO_PROJECT"]
to the notebooks with the possibility to activate it. By default it has the value ofBase.active_project()
which in practice is the environmentruntests.jl
is running in. As a consequence, if this default is kept, it is necessary to have all package dependencies of the notebooks in the package environment.
ExampleJuggler.@testplutonotebooks
— Macro @testplutonotebooks(example_dir,notebooks, kwargs...)
Macro wrapper for testplutonotebooks
. Just for aestethic reasons, as other parts of the API have to be macros.