API

Tip

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.docplutonotebooksFunction
docplutonotebooks(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 not nothing, this is passed via ENV["PLUTO_PROJECT"] to the notebooks with the possibility to activate it. By default it has the value of Base.active_project() which in practice is the environment runtests.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 is import PlutoSliderServer in docs/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 in docs/make.jl.
  • distributed: Use parallel evaluation when iframe==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()

source

Testing

ExampleJuggler.testplutonotebooksFunction
 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 examples
  • notebooks: vector of pathnames of notebooks to be tested.

Keyword arguments:

  • pluto_project: if not nothing, this is passed via ENV["PLUTO_PROJECT"] to the notebooks with the possibility to activate it. By default it has the value of Base.active_project() which in practice is the environment runtests.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.
source