Internal API
ExampleJuggler.replace_source_url
— Functionreplace_source_url(input, source_url)
Replace "@SOURCE_URL" marker with url of source. Used for preprocessing the input of Literate.markdown
in ExampleJuggler.docmodules
.
ExampleJuggler.replace_atat
— Function replace_atat(input)
Replace "@@" marker with "@". Used for postprocessing the output of Literate.markdown
in ExampleJuggler.docmodules
.
ExampleJuggler.testplutonotebook
— Functiontestplutonotebook(notebookname;
pluto_project = nothing)
Test pluto notebook in a Pluto session. Core of testplutonotebooks
. Implemented in extension ExampleJugglerPlutoExt
.
ExampleJuggler.docplutostatichtml
— Functiondocplutostatichtml(example_dir, notebooks;
pluto_project = nothing,
ntasks = Threads.nthreads())
Document notebooks via PlutoStaticHTML.jl. Implemented in extension ExampleJugglerPlutoStaticHTMLExt
.
Parameters:
example_dir
: Directory where notebooks reside.notebooks
: Vector of notebook file names relative toexample_dir
.
Keyword arguments:
pluto_project
: passed asENV[PLUTO_PROJECT]
to notebooks. Seetestplutonotebooks
for explanation.ntasks
: number of parallel tasks.
Returns: Vector of markdown file names (one for each notebook) ready to be passed to makedocs
.
ExampleJuggler.docplutosliderserver
— Functiondocplutosliderserver(example_dir, notebooks;
pluto_project = nothing,
ntasks = Threads.nthreads(),
source_prefix = "",
iframe_height = "500px",
force = true)
Document notebooks via PlutoSliderServer.jl Implemented in extension ExampleJugglerPlutoSliderServerExt
. Rendered notebooks will appear in iframes.
Parameters:
example_dir
: Directory where notebooks residenotebooks
: Vector of notebook file names relative toexample_dir
Keyword arguments:
pluto_project
: passed asENV[PLUTO_PROJECT]
to notebooks. Seetestplutonotebooks
for explanation.ntasks
: number of parallel tasks.source_prefix
: Prefix of notebook source file on github.iframe_height
: Height of iframe.force
: force ovewriting of already rendered notebooks.
Returns: Vector of markdown file names (one for each notebook) ready to be passed to makedocs
.
ExampleJuggler.@testscript
— Macro@testscript(script, kwargs)
Wrap script (or Pluto notebook seen as script) into a custom module and evaluate it in the context of the calling module. If the script contains a function runtests
, call runtests(;kwargs...)
, It is assumed that the script uses Test.@test
to test correctness.
ExampleJuggler.@testmodule
— Macro@testmodule(source, kwargs...)
Include script defining a module in the context of the calling module and call the runtests
method if it is defined in this module, passing kwargs...
.
ExampleJuggler.@plotmodule
— Macro@plotmodule(modules, kwargs...)
Include module into context of calling module and execute generateplots(;kwargs...)
if it exists.
ExampleJuggler.@plotmodules
— Macro@plotmodules(modules, kwargs...)
Plot several scripts defining modules via @plotmodule
.
ExampleJuggler.docmodules
— Function docmodules(example_dir, example_modules; kwargs...)
Generate markdown files for use with documenter from list of Julia code examples in example_dir
via Literate.jl in form of modules.
Keyword arguments:
use_module_titles
: use titles from module input filesuse_script_titles
: use titles from script input files
See ExampleModule.jl for an example.
ExampleJuggler.@plotscript
— Macro@plotscript(script, kwargs...)
Wrap script into a custom module and evaluate it in the context of the calling module. If the script contains a function generateplots
, call it as generateplots(output_dir; kwargs...)
where output_dir
is the name of the directory where the plot files should be written.
ExampleJuggler.@plotscripts
— Macro@plotscripts(example_dir, scripts, kwargs...)
Run ExampleJuggler.@plotscript
for each script in scripts
.
ExampleJuggler.parsescript
— Functionparsescript(source)
Read script source, wrap it into a module with random name and return this module.
ExampleJuggler.randmod
— Functionrandmod()
Generate a random module name.
ExampleJuggler.startroot!
— Functionstartroot!(dir)
Assume dir
is the directory from which make.jl
has been invoked (normally, package root or the docs
subdirectory). Used in example_md_dir
.
ExampleJuggler.example_md_dir
— Function example_md_dir(subdir)
Return full path to the subdirectory of docs/src where the markdown files should be placed which later will be scanned by Documenter. Creates the directory if it doesn't already exist.