Skip to content

Commit

Permalink
🦛 Fix #542
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Nov 5, 2020
1 parent 8c2758d commit 82ed697
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/evaluation/WorkspaceManager.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ end

"These expressions get evaluated inside every newly create module inside a `Workspace`."
const workspace_preamble = [
:(using Markdown, InteractiveUtils, Main.PlutoRunner),
:(using Main.PlutoRunner, Main.PlutoRunner.Markdown, Main.PlutoRunner.InteractiveUtils),
:(show, showable, showerror, repr, string, print, println), # https://github.com/JuliaLang/julia/issues/18181
]

"These expressions get evaluated whenever a new `Workspace` process is created."
const process_preamble = [
:(ccall(:jl_exit_on_sigint, Cvoid, (Cint,), 0)),
:(include($(project_relative_path("src", "runner", "PlutoRunner.jl")))),
:(include($(project_relative_path("src", "runner", "Loader.jl")))),
:(ENV["GKSwstype"] = "nul"),
:(ENV["JULIA_REVISE_WORKER_ONLY"] = "1"),
]
Expand Down
15 changes: 15 additions & 0 deletions src/runner/Loader.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const my_dir = @__DIR__
const pluto_dir = joinpath(my_dir, "..", "..")

pushfirst!(LOAD_PATH, pluto_dir)

#
include(joinpath(my_dir, "PlutoRunner.jl"))
#

let
i = findfirst(isequal(pluto_dir), LOAD_PATH)
if i !== nothing
deleteat!(LOAD_PATH, i)
end
end
4 changes: 4 additions & 0 deletions src/runner/PlutoRunner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

module PlutoRunner

# import these two so that they can be imported from Main on the worker process if it launches without the stdlibs in its LOAD_PATH
import Markdown
import InteractiveUtils

using Markdown
import Markdown: html, htmlinline, LaTeX, withtag, htmlesc
import Distributed
Expand Down

0 comments on commit 82ed697

Please sign in to comment.