Skip to content

Commit dda18b4

Browse files
feat(showcase): refactor LocalImage function to accept keyword arguments for improved image handling
1 parent 370c16f commit dda18b4

3 files changed

Lines changed: 17 additions & 15 deletions

File tree

binder/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
jupyter-pluto-proxy
1+
julia=1.11

binder/start

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
set -euxo pipefail
33

44
# Start Pluto on the Binder port and open your notebook
5-
exec julia -e '
5+
exec julia --project=binder -e '
66
import Pluto
77
import WGLMakie; WGLMakie.activate!()
88
using PlutoStyles
99
Pluto.run(host = "0.0.0.0",
1010
port = parse(Int, get(ENV, "PORT", "8888")),
1111
launch_browser = false,
12-
require_secret_for_open = false,
12+
require_secret_for_open_links=false,
13+
require_secret_for_access=false,
1314
)
1415
'

showcase/showcase1.jl

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ begin
7474
write(io, "</p></details>")
7575
end
7676

77-
LocalImage(x, kwargs) = LocalResource(joinpath(@__DIR__, "assets", "img", x), kwargs...)
78-
end
77+
LocalImage(x::AbstractString; attrs...) =
78+
LocalResource(joinpath(@__DIR__, "assets", "img", x), pairs(attrs)...)
79+
end;
7980

8081
# ╔═╡ b806b033-db55-4033-a975-ae3fe609b345
8182
md"""#
@@ -145,7 +146,7 @@ TwoColumn(
145146
2. ###### **Protection** of cable-based systems
146147
3. ###### **Control** interactions
147148
4. ###### **Resilient HVDC** grids
148-
$(LocalResource(joinpath(@__DIR__, "assets", "img", "future_grids.svg"), :width => 600, :style => "display: block; float: left; margin-left: auto; margin-right: auto;"))
149+
$(LocalImage("future_grids.svg", width = 600, style = "display: block; float: left; margin-left: auto; margin-right: auto;"))
149150
""")
150151

151152
# ╔═╡ 3e6a9c64-827d-4491-bcac-252ee7b1dc81
@@ -171,8 +172,8 @@ TwoColumn(
171172
- #### Cables as a part of multi-GW future power grids.
172173
173174
""",
174-
md"""$(LocalImage("cables1.png", :width => 250, :style => "display: block; margin-left: auto; margin-right: auto; margin-bottom: 50px;"))
175-
$(LocalImage("cables2.png"), :width => 250, :style => "display: block; margin-left: auto; margin-right: auto;"))
175+
md"""$(LocalImage("cables1.png", width=250, style="display: block; margin-left: auto; margin-right: auto; margin-bottom: 50px;"))
176+
$(LocalImage("cables2.png", width=250, style="display: block; margin-left: auto; margin-right: auto;"))
176177
""")
177178

178179
# ╔═╡ a3f5a8c5-4ab9-4a33-abab-7907ffab1347
@@ -669,22 +670,22 @@ md"""
669670

670671
# ╔═╡ Cell order:
671672
# ╠═a82fd7fe-465d-4744-870f-638a72a54317
672-
# ╠═7b9396bd-5253-4ecd-b863-c7f9ae47cc65
673-
# ╠═e85bf184-df3d-45b1-a4d8-958e75ae71b8
674-
# ╠═4462e48f-0d08-4ad9-8dd9-12f4f5912f38
675-
# ╠═b806b033-db55-4033-a975-ae3fe609b345
673+
# ╟─7b9396bd-5253-4ecd-b863-c7f9ae47cc65
674+
# ╟─e85bf184-df3d-45b1-a4d8-958e75ae71b8
675+
# ╟─4462e48f-0d08-4ad9-8dd9-12f4f5912f38
676+
# ╟─b806b033-db55-4033-a975-ae3fe609b345
676677
# ╟─de026730-c3ad-4fda-9140-84f11370a7fc
677678
# ╟─f08a32db-05d9-4ddb-9c46-34bc623ce5e7
678679
# ╟─50384351-fc38-4b29-9bf6-db1556d49dee
679680
# ╟─23913cc6-a81b-4098-bacf-7a2e09998e53
680681
# ╟─d482241c-4bd5-4896-bdc1-e82387f69051
681682
# ╟─14f07acc-5353-4b1d-b94f-9ae43f87289b
682683
# ╟─a38bd2da-4ee7-4b16-88ae-f2eeb426dff3
683-
# ╠═6c6e4d21-cc38-46eb-8178-4cc4a99adcba
684+
# ╟─6c6e4d21-cc38-46eb-8178-4cc4a99adcba
684685
# ╟─3e6a9c64-827d-4491-bcac-252ee7b1dc81
685-
# ╠═877a84cc-979f-48c9-ac41-59be60b4850b
686+
# ╟─877a84cc-979f-48c9-ac41-59be60b4850b
686687
# ╟─a3f5a8c5-4ab9-4a33-abab-7907ffab1347
687-
# ╠═3ff0eea3-9f1d-487f-a752-be6462f4bfb7
688+
# ╟─3ff0eea3-9f1d-487f-a752-be6462f4bfb7
688689
# ╟─a8ea0da0-36f1-44d4-9415-d3041f34c23f
689690
# ╟─f5fa7e28-97a7-456b-87a9-5ac4b76be9d4
690691
# ╟─8c2eaef0-4e01-41b9-b1a6-a20dfa9b2d57

0 commit comments

Comments
 (0)