From 96fe01e45352b503596a04c8711bf1f848fbad0d Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Sat, 10 Aug 2024 16:25:16 +0200 Subject: [PATCH] Support more kwargs to generate(::String) --- Project.toml | 2 +- src/PlutoPages.jl | 6 +++--- test/runtests.jl | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Project.toml b/Project.toml index 3fca10a..d523f56 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PlutoPages" uuid = "d5dc3dd1-4774-47c7-8860-0a1ad9e34b8c" authors = ["Luca Ferranti", "Fons van der Plas"] -version = "0.1.4" +version = "0.1.5" [deps] BetterFileWatching = "c9fd44ac-77b5-486c-9482-9798bd063cc6" diff --git a/src/PlutoPages.jl b/src/PlutoPages.jl index e282302..0980053 100644 --- a/src/PlutoPages.jl +++ b/src/PlutoPages.jl @@ -94,8 +94,8 @@ function create_subdirs(root_dir::String) ) end -function develop(root_dir::String) - develop(;create_subdirs(root_dir)...) +function develop(root_dir::String; kwargs...) + develop(;create_subdirs(root_dir)..., kwargs...) end @@ -199,7 +199,7 @@ function generate(; return output_dir end -generate(root_dir::String) = generate(;create_subdirs(root_dir)...) +generate(root_dir::String; kwargs...) = generate(;create_subdirs(root_dir)..., kwargs...) function create_test_basic_site() diff --git a/test/runtests.jl b/test/runtests.jl index a8454c7..596dedb 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -7,7 +7,9 @@ using Test dirs = PlutoPages.create_subdirs(input_dir) - result = PlutoPages.generate(; dirs...) + html_report_path = tempname(cleanup=false) + + result = PlutoPages.generate(; dirs..., html_report_path) @test result == dirs.output_dir @info "Done!" dirs readdir(dirs.input_dir) readdir(dirs.output_dir) @@ -22,5 +24,5 @@ using Test @test isfile(joinpath(dirs.output_dir, "en", "blog", "something", "index.html")) @test isfile(joinpath(dirs.output_dir, "en", "blog", "yayy", "index.html")) - + @test isfile(html_report_path) end