Skip to content

Commit e738137

Browse files
feat(showcase): update Pluto notebooks with new interactive features and corporate styling
1 parent dd18bce commit e738137

2 files changed

Lines changed: 96 additions & 2 deletions

File tree

docs/showcase/pluto/hello.jl

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,4 +330,51 @@ version = "17.4.0+2"
330330
# ╠═83def218-0a73-4808-acbb-47491780a8c3
331331
# ╠═161e535b-b177-4fd3-9968-68e9ebe3909e
332332
# ╟─00000000-0000-0000-0000-000000000001
333-
# ╟─00000000-0000-0000-0000-000000000002
333+
# ╟─00000000-0000-0000-0000-000000000002
334+
### A Pluto.jl notebook ###
335+
# v0.19.43
336+
337+
using Markdown
338+
using InteractiveUtils
339+
340+
# ╔═╡ 11111111-1111-1111-1111-111111111111
341+
begin
342+
import Pkg
343+
try
344+
using HypertextLiteral
345+
catch
346+
Pkg.add("HypertextLiteral"); using HypertextLiteral
347+
end
348+
# Inject corporate CSS
349+
css = read("docs/showcase/pluto/corporate.css", String)
350+
@htl("<style>$(css)</style>")
351+
end
352+
353+
# ╔═╡ 22222222-2222-2222-2222-222222222222
354+
md"""
355+
# Pluto Demo (Hello)
356+
Adjust N and recompute a couple of expressions.
357+
"""
358+
359+
# ╔═╡ 33333333-3333-3333-3333-333333333333
360+
begin
361+
import Pkg
362+
try
363+
using PlutoUI
364+
catch
365+
Pkg.add("PlutoUI"); using PlutoUI
366+
end
367+
nothing
368+
end
369+
370+
# ╔═╡ 44444444-4444-4444-4444-444444444444
371+
@bind N Slider(1:50; default=10, show_value=true)
372+
373+
# ╔═╡ 55555555-5555-5555-5555-555555555555
374+
sum_squares = sum(i^2 for i in 1:N)
375+
376+
# ╔═╡ 66666666-6666-6666-6666-666666666666
377+
prod_small = prod(1:5)
378+
379+
# ╔═╡ 77777777-7777-7777-7777-777777777777
380+
md"sum(i^2 for i in 1:N) = $(sum_squares)\n\nprod(1:5) = $(prod_small)"

docs/showcase/pluto/plot.jl

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1181,4 +1181,51 @@ version = "1.9.2+0"
11811181
# ╠═fe7cd2d7-8f42-48c5-b453-b10263e282a9
11821182
# ╠═dfe372ba-082c-4fe1-8f4e-0f32c295594b
11831183
# ╟─00000000-0000-0000-0000-000000000001
1184-
# ╟─00000000-0000-0000-0000-000000000002
1184+
# ╟─00000000-0000-0000-0000-000000000002
1185+
### A Pluto.jl notebook ###
1186+
# v0.19.43
1187+
1188+
using Markdown
1189+
using InteractiveUtils
1190+
1191+
# ╔═╡ aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
1192+
begin
1193+
import Pkg
1194+
try
1195+
using HypertextLiteral
1196+
catch
1197+
Pkg.add("HypertextLiteral"); using HypertextLiteral
1198+
end
1199+
css = read("docs/showcase/pluto/corporate.css", String)
1200+
@htl("<style>$(css)</style>")
1201+
end
1202+
1203+
# ╔═╡ bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb
1204+
md"""
1205+
# Pluto Plot Demo
1206+
Interactively change N and see the curve update.
1207+
"""
1208+
1209+
# ╔═╡ cccccccc-cccc-cccc-cccc-cccccccccccc
1210+
begin
1211+
import Pkg
1212+
try
1213+
using PlutoUI, Plots
1214+
catch
1215+
Pkg.add(["PlutoUI","Plots"]); using PlutoUI, Plots
1216+
end
1217+
nothing
1218+
end
1219+
1220+
# ╔═╡ dddddddd-dddd-dddd-dddd-dddddddddddd
1221+
@bind N Slider(10:10:200; default=50, show_value=true)
1222+
1223+
# ╔═╡ eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee
1224+
x = 0:0.01:2π
1225+
1226+
# ╔═╡ ffffffff-ffff-ffff-ffff-ffffffffffff
1227+
y = @. sin(N * x) * exp(-0.2x)
1228+
1229+
# ╔═╡ 99999999-9999-9999-9999-999999999999
1230+
plot(x, y, lw=2, color=:cyan, bg=:transparent, legend=false,
1231+
xlabel="x", ylabel="y", title="y = sin(Nx) * exp(-0.2x)")

0 commit comments

Comments
 (0)