Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .JuliaFormatter.toml

This file was deleted.

4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
os:
- ubuntu-latest
- windows-latest
- macOS-13 # intel
- macOS-14 # arm
arch:
- x64
Expand All @@ -31,8 +30,6 @@ jobs:
arch: aarch64
- os: windows-latest
arch: aarch64
- os: macOS-13
arch: aarch64
- os: macOS-14
arch: x64
steps:
Expand Down Expand Up @@ -77,4 +74,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}

45 changes: 0 additions & 45 deletions .github/workflows/format_check.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: code quality checks

on:
pull_request:

jobs:
pre-commit:
name: run pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v2
with:
version: 1
- run: |
julia --project=@runic -e '
using Pkg
Pkg.add("Runic")'
env:
PYTHON: ""
- uses: actions/setup-python@v6
- uses: pre-commit/action@v3.0.1
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
args: [--maxkb=8192]
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
args: [--allow-multiple-documents]
- id: end-of-file-fixer
- id: no-commit-to-branch
args: [--branch,master]
- repo: https://github.com/gitleaks/gitleaks
rev: v8.24.2
hooks:
- id: gitleaks
- repo: https://github.com/fredrikekre/runic-pre-commit
rev: v1.0.0
hooks:
- id: runic
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## [2.5.0] - 2026-01-08
- run script tests in the directory where script is located
- runic format and other checks

## [2.4.0] - 2025-10-31
- Improve error output for script testing
- get rid of Base.get_extension
Expand Down Expand Up @@ -48,4 +52,3 @@ All notable changes to this project will be documented in this file.
- Use distributed for static html generation from notebooks
- Add `use_module_titles` flag for @docmodules
- Set version to 1.0.0 for full SemVer

2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ExampleJuggler"
uuid = "3bbe58f8-ed81-4c4e-a134-03e85fcf4a1a"
authors = ["Jürgen Fuhrmann <juergen-fuhrmann@web.de>"]
version = "2.4"
version = "2.5"

[deps]
ChunkSplitters = "ae650224-84b6-46f8-82ea-d812ca08434e"
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,3 @@ deploydocs(; repo = "github.com/j-fu/ExampleJuggler.jl.git", devbranch = "main")
end
```
In particular, graphics generation for module and script examples is supported.

3 changes: 1 addition & 2 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# API
!!! tip
All additonal packages used in tests or docs need to be recorded in
All additional packages used in tests or docs need to be recorded in
`tests/Project.toml` resp. `docs/Project.toml`, preferably with a [compat] entry.


Expand All @@ -21,4 +21,3 @@ ExampleJuggler.verbose!
testplutonotebooks
@testplutonotebooks
```

3 changes: 0 additions & 3 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@ ExampleJuggler
```@contents
Depth=5
```



45 changes: 45 additions & 0 deletions examples/ExamplePluto2.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
### A Pluto.jl notebook ###
# v0.20.21

using Markdown
using InteractiveUtils

# ╔═╡ b285aca3-dee5-4b77-9276-537563e8643b
begin
using Pkg
Pkg.activate(joinpath(@__DIR__, ".."))
# using Revise
using Test
using ExampleJuggler
end;

# ╔═╡ 200a864a-d50e-45fa-915a-283c71ce8686
md"""
# Graphics example
"""

# ╔═╡ 50e60295-2bb6-4aea-aea7-e600dad18bbd
x, fx = mock_x()

# ╔═╡ 51a7525b-8afd-46cd-8334-f6acd3062bf6
y, t, fyt = mock_xt()

# ╔═╡ dd736474-3cbf-4b09-8dbb-0ab16fce6c5e
function runtests()
# hideall
@test isapprox(maximum(fyt), 1.0; rtol = 1.0e-3)
@test splitpath(pwd())[end] == "examples"
@test isapprox(maximum(fx), 1.0; rtol = 1.0e-3)
return
end;

# ╔═╡ e87fd871-04be-4dbc-b933-3daeb11002b9
runtests()

# ╔═╡ Cell order:
# ╟─200a864a-d50e-45fa-915a-283c71ce8686
# ╠═b285aca3-dee5-4b77-9276-537563e8643b
# ╠═50e60295-2bb6-4aea-aea7-e600dad18bbd
# ╠═51a7525b-8afd-46cd-8334-f6acd3062bf6
# ╠═dd736474-3cbf-4b09-8dbb-0ab16fce6c5e
# ╠═e87fd871-04be-4dbc-b933-3daeb11002b9
2 changes: 1 addition & 1 deletion src/modules.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ for use with documenter from list of Julia modules.
Wrapper macro for [`docmodules`](@ref) and [`ExampleJuggler.@plotmodules`](@ref).

Parameters:
- `example_dir`: subdirectory where the files coresponding to the modules reside.
- `example_dir`: subdirectory where the files corresponding to the modules reside.
- `modules`: Vector of file names or pairs `"title" => "filename"` as in
[Documenter.jl](https://documenter.juliadocs.org/stable/man/guide/#Pages-in-the-Sidebar).

Expand Down
8 changes: 4 additions & 4 deletions src/plutoext.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Keyword arguments:
- `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.
- `force`: force overwriting of already rendered notebooks.


Returns: Vector of markdown file names (one for each notebook) ready to be passed to `makedocs`.
Expand Down Expand Up @@ -109,7 +109,7 @@ end
@testplutonotebooks(example_dir,notebooks, kwargs...)

Macro wrapper for [`testplutonotebooks`](@ref).
Just for aestethic reasons, as other parts of the API have to be macros.
Just for aesthetic reasons, as other parts of the API have to be macros.
"""
macro testplutonotebooks(example_dir, notebooks, kwargs...)
return esc(:(ExampleJuggler.testplutonotebooks($example_dir, $notebooks; $(kwargs...))))
Expand All @@ -133,7 +133,7 @@ Keyword arguments:
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](https://github.com/rikhuijzer/PlutoStaticHTML.jl). These integrate well with
- If false, Documenter markdown files are created via [PlutoStaticHTML.jl](https://github.com/rikhuijzer/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
Expand Down Expand Up @@ -174,7 +174,7 @@ end
@docplutonotebooks(example_dir, notebooklist, kwargs...)

Macro wrapper for [`docplutonotebooks`](@ref).
Just for aestethic reasons, as other parts of the API have to be macros.
Just for aesthetic reasons, as other parts of the API have to be macros.
"""
macro docplutonotebooks(example_dir, notebooklist, kwargs...)
return esc(:(docplutonotebooks($example_dir, $notebooklist; $(kwargs...))))
Expand Down
10 changes: 6 additions & 4 deletions src/scripts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ macro testscript(source, kwargs...)
:(
ExampleJuggler.verbose() && @info "Testing " * basename($(source));
try
mod = eval(ExampleJuggler.parsescript($(source)))
if Base.invokelatest(isdefined, mod, :runtests)
Base.invokelatest(Base.invokelatest(getproperty, mod, :runtests); $(kwargs...))
cd(dirname($source)) do
mod = eval(ExampleJuggler.parsescript($(source)))
if Base.invokelatest(isdefined, mod, :runtests)
Base.invokelatest(Base.invokelatest(getproperty, mod, :runtests); $(kwargs...))
end
end
catch err
@error "Error in $(source): $(err)"
Expand Down Expand Up @@ -105,7 +107,7 @@ Generate markdown files and plots (via the respective `generateplots` methods)


Parameters:
- `example_dir`: subdirectory where the files coresponding to the modules reside.
- `example_dir`: subdirectory where the files corresponding to the modules reside.
- `scripts`: Vector of file names or pairs `"title" => "filename"` as in
[Documenter.jl](https://documenter.juliadocs.org/stable/man/guide/#Pages-in-the-Sidebar).

Expand Down
12 changes: 5 additions & 7 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Test, Aqua
using ExampleJuggler

import Pluto

if isdefined(Docs, :undocumented_names) # >=1.11
@testset "undocumented names" begin
Expand All @@ -25,14 +25,12 @@ ExampleJuggler.verbose!(true)
example_dir = joinpath(@__DIR__, "..", "examples")

modules = ["ExampleModule.jl"]
notebooks = ["PlutoTemplate.jl", "ExamplePluto.jl"]
notebooks = ["PlutoTemplate.jl", "ExamplePluto.jl", "ExamplePluto2.jl"]
scripts = ["ExampleScript.jl"]

# This kind of test needs `import Pluto`
# and has been temporarily disabled due to lacking support on Julia nightly
# @testset "pluto notebooks" begin
# @testplutonotebooks(example_dir, notebooks)
# end
@testset "pluto notebooks" begin
@testplutonotebooks(example_dir, notebooks)
end

# This kind of test works without Pluto
@testset "notebooks as scripts" begin
Expand Down
Loading