From 3dc291f95f8faed5dc07b9233ad7cd624e07c9c0 Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Sat, 10 Aug 2024 17:06:48 +0200 Subject: [PATCH] fix abs path problem --- Project.toml | 2 +- src/PlutoPages.jl | 4 ++++ src/pluto control.jl | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index d523f56..289aebe 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.5" +version = "0.1.6" [deps] BetterFileWatching = "c9fd44ac-77b5-486c-9482-9798bd063cc6" diff --git a/src/PlutoPages.jl b/src/PlutoPages.jl index 0980053..fbecf1c 100644 --- a/src/PlutoPages.jl +++ b/src/PlutoPages.jl @@ -59,6 +59,9 @@ function run_plutopages_notebook(; cache_dir::String, kwargs... ) + @assert isabspath(input_dir) + @assert isabspath(output_dir) + @assert isabspath(cache_dir) run_with_replacements( PlutoPages_notebook_path, plutopages_replacements(; input_dir, output_dir, cache_dir, ap=Base.active_project(), lp=LOAD_PATH); @@ -83,6 +86,7 @@ end function create_subdirs(root_dir::String) + root_dir = Pluto.tamepath(root_dir) @assert isdir(root_dir) input_dir = joinpath(root_dir, "src") @assert isdir(input_dir) "Input directory is empty: $(input_dir).\n\nUse PlutoPages in a directory with a 'src' subdirectory. Your notebooks and markdown files go in there." diff --git a/src/pluto control.jl b/src/pluto control.jl index 757ed57..5685976 100644 --- a/src/pluto control.jl +++ b/src/pluto control.jl @@ -54,7 +54,7 @@ function run_with_replacements(notebook_path::AbstractString, inputs::Dict{Symbo ) session = Pluto.ServerSession(;options) - @info "PlutoPages: Starting Pluto server..." + @info "PlutoPages: Starting Pluto notebook..." notebook_task = Threads.@spawn try notebook = open_notebook_with_replacements!(session, notebook_path, inputs) @@ -90,6 +90,7 @@ function run_with_replacements(notebook_path::AbstractString, inputs::Dict{Symbo end pluto_server_instance = if run_server + @info "PlutoPages: Starting Pluto server... \n(Ignore the message 'Go to ... in your browser to start writing.')" Pluto.run!(session) end