Skip to content

Commit 0bb700f

Browse files
fix(showcase): add launcher script for Pluto notebook
1 parent 15de61c commit 0bb700f

3 files changed

Lines changed: 29 additions & 2 deletions

File tree

binder/start

100755100644
File mode changed.

showcase/showcase1.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ begin
1515
WGLMakie.activate!()
1616
using Makie, PlutoUI, Colors
1717
using LineCableModels
18+
using DataFrames
1819
end
1920

2021
# ╔═╡ 7b9396bd-5253-4ecd-b863-c7f9ae47cc65
@@ -273,7 +274,7 @@ TwoColumn(
273274
diameter = [round(d, digits = 2) for d in getindex.(layers, 3)], # hide
274275
))
275276
""",
276-
md"""$(LocalResource(joinpath(@__DIR__, "cable_photo.jpg"), :width => 350, :style => "display: block; margin-top: 50px; margin-left: auto; margin-right: auto;"))
277+
md"""$(LocalImage("cable_photo.jpg", width = 350, style = "display: block; margin-top: 50px; margin-left: auto; margin-right: auto;"))
277278
""")
278279

279280
# ╔═╡ 29222f8e-fb07-4bdb-8939-f18e668d2037
@@ -690,7 +691,7 @@ md"""
690691
# ╟─f5fa7e28-97a7-456b-87a9-5ac4b76be9d4
691692
# ╟─8c2eaef0-4e01-41b9-b1a6-a20dfa9b2d57
692693
# ╟─cb8f01ae-26e0-44ce-8347-298ab692ac63
693-
# ╠═29222f8e-fb07-4bdb-8939-f18e668d2037
694+
# ╟─29222f8e-fb07-4bdb-8939-f18e668d2037
694695
# ╟─c1595a9d-7882-4b66-a1fc-fe6de19f1ef6
695696
# ╟─c13e262c-2dd2-43da-a01b-a95adb7eaa7d
696697
# ╠═c2539b01-ac04-48e4-a973-6a5d8a0e2b58

showcase/start.jl

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# This script launches Pluto and opens a specific notebook file.
2+
using Pluto
3+
using PlutoStyles
4+
5+
# Define the path to the notebook file.
6+
# notebook_path = "/home/amartins/Documents/KUL/LineCableModels/showcase/showcase1.jl"
7+
8+
# println("Starting Pluto and opening notebook: ", notebook_path)
9+
println("Starting Pluto, check your browser...")
10+
11+
try
12+
# Run Pluto, telling it which notebook to open
13+
Pluto.run(launch_browser = true)
14+
15+
# Keep the script alive so the Pluto server doesn't shut down immediately.
16+
println("\nPluto server is running. Press Ctrl+C in this terminal to stop.")
17+
wait(Condition()) # Waits indefinitely until interrupted (Ctrl+C)
18+
19+
println("\nAn error occurred while trying to run Pluto:")
20+
showerror(stdout, e)
21+
Base.show_backtrace(stdout, catch_backtrace())
22+
finally
23+
println("\nPluto server stopped.")
24+
end
25+
26+
println("Launcher script finished.")

0 commit comments

Comments
 (0)