Skip to content

Commit 9a2ec1e

Browse files
fix(showcase): test snippets
1 parent 172c99e commit 9a2ec1e

2 files changed

Lines changed: 1495 additions & 31 deletions

File tree

docs/showcase/pluto/hello.jl

Lines changed: 324 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,333 @@
1-
# Minimal Pluto demo: tweak N with a slider and recompute.
2-
# This file can be opened by Pluto via Binder proxy.
3-
4-
begin
5-
import Pkg
6-
# Ensure PlutoUI is available when running on Binder
7-
try
8-
using PlutoUI
9-
catch
10-
Pkg.add("PlutoUI"); using PlutoUI
1+
### A Pluto.jl notebook ###
2+
# v0.20.17
3+
4+
using Markdown
5+
using InteractiveUtils
6+
7+
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
8+
macro bind(def, element)
9+
#! format: off
10+
return quote
11+
local iv = try Base.loaded_modules[Base.PkgId(Base.UUID("6e696c72-6542-2067-7265-42206c756150"), "AbstractPlutoDingetjes")].Bonds.initial_value catch; b -> missing; end
12+
local el = $(esc(element))
13+
global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : iv(el)
14+
el
1115
end
16+
#! format: on
1217
end
1318

14-
md"""
15-
# Pluto Demo (Hello)
16-
Adjust N and recompute a couple of expressions.
19+
# ╔═╡ 43cf38af-b7ca-4491-a592-b0eace48ed79
20+
using PlutoUI
21+
22+
# ╔═╡ 59ad62d3-f9ec-4cb6-bcd6-d89cb24c6a3e
23+
@bind N Slider(1:100; default=10, show_value=true)
24+
25+
# ╔═╡ 83def218-0a73-4808-acbb-47491780a8c3
26+
sum(i^2 for i in 1:N)
27+
28+
# ╔═╡ 161e535b-b177-4fd3-9968-68e9ebe3909e
29+
prod(1:N)
30+
31+
# ╔═╡ 00000000-0000-0000-0000-000000000001
32+
PLUTO_PROJECT_TOML_CONTENTS = """
33+
[deps]
34+
PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
35+
36+
[compat]
37+
PlutoUI = "~0.7.71"
1738
"""
1839

19-
@bind N Slider(1:50, default=10)
40+
# ╔═╡ 00000000-0000-0000-0000-000000000002
41+
PLUTO_MANIFEST_TOML_CONTENTS = """
42+
# This file is machine-generated - editing it directly is not advised
43+
44+
julia_version = "1.11.6"
45+
manifest_format = "2.0"
46+
project_hash = "0c76a76c3ac8f04e01e91e0dc955aee1f9d81e4a"
47+
48+
[[deps.AbstractPlutoDingetjes]]
49+
deps = ["Pkg"]
50+
git-tree-sha1 = "6e1d2a35f2f90a4bc7c2ed98079b2ba09c35b83a"
51+
uuid = "6e696c72-6542-2067-7265-42206c756150"
52+
version = "1.3.2"
53+
54+
[[deps.ArgTools]]
55+
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
56+
version = "1.1.2"
57+
58+
[[deps.Artifacts]]
59+
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
60+
version = "1.11.0"
61+
62+
[[deps.Base64]]
63+
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
64+
version = "1.11.0"
65+
66+
[[deps.ColorTypes]]
67+
deps = ["FixedPointNumbers", "Random"]
68+
git-tree-sha1 = "67e11ee83a43eb71ddc950302c53bf33f0690dfe"
69+
uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
70+
version = "0.12.1"
71+
72+
[deps.ColorTypes.extensions]
73+
StyledStringsExt = "StyledStrings"
74+
75+
[deps.ColorTypes.weakdeps]
76+
StyledStrings = "f489334b-da3d-4c2e-b8f0-e476e12c162b"
77+
78+
[[deps.CompilerSupportLibraries_jll]]
79+
deps = ["Artifacts", "Libdl"]
80+
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
81+
version = "1.1.1+0"
82+
83+
[[deps.Dates]]
84+
deps = ["Printf"]
85+
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
86+
version = "1.11.0"
87+
88+
[[deps.Downloads]]
89+
deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"]
90+
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
91+
version = "1.6.0"
92+
93+
[[deps.FileWatching]]
94+
uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
95+
version = "1.11.0"
96+
97+
[[deps.FixedPointNumbers]]
98+
deps = ["Statistics"]
99+
git-tree-sha1 = "05882d6995ae5c12bb5f36dd2ed3f61c98cbb172"
100+
uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
101+
version = "0.8.5"
102+
103+
[[deps.Hyperscript]]
104+
deps = ["Test"]
105+
git-tree-sha1 = "179267cfa5e712760cd43dcae385d7ea90cc25a4"
106+
uuid = "47d2ed2b-36de-50cf-bf87-49c2cf4b8b91"
107+
version = "0.0.5"
108+
109+
[[deps.HypertextLiteral]]
110+
deps = ["Tricks"]
111+
git-tree-sha1 = "7134810b1afce04bbc1045ca1985fbe81ce17653"
112+
uuid = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2"
113+
version = "0.9.5"
114+
115+
[[deps.IOCapture]]
116+
deps = ["Logging", "Random"]
117+
git-tree-sha1 = "b6d6bfdd7ce25b0f9b2f6b3dd56b2673a66c8770"
118+
uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89"
119+
version = "0.2.5"
120+
121+
[[deps.InteractiveUtils]]
122+
deps = ["Markdown"]
123+
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
124+
version = "1.11.0"
125+
126+
[[deps.JSON]]
127+
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
128+
git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a"
129+
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
130+
version = "0.21.4"
131+
132+
[[deps.LibCURL]]
133+
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
134+
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
135+
version = "0.6.4"
136+
137+
[[deps.LibCURL_jll]]
138+
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
139+
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
140+
version = "8.6.0+0"
141+
142+
[[deps.LibGit2]]
143+
deps = ["Base64", "LibGit2_jll", "NetworkOptions", "Printf", "SHA"]
144+
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
145+
version = "1.11.0"
146+
147+
[[deps.LibGit2_jll]]
148+
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"]
149+
uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5"
150+
version = "1.7.2+0"
151+
152+
[[deps.LibSSH2_jll]]
153+
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
154+
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
155+
version = "1.11.0+1"
156+
157+
[[deps.Libdl]]
158+
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
159+
version = "1.11.0"
160+
161+
[[deps.LinearAlgebra]]
162+
deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"]
163+
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
164+
version = "1.11.0"
20165
21-
md"N = $(N)"
166+
[[deps.Logging]]
167+
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
168+
version = "1.11.0"
22169
23-
sum_squares = sum(i^2 for i in 1:N)
24-
prod_small = prod(i for i in 1:5)
170+
[[deps.MIMEs]]
171+
git-tree-sha1 = "c64d943587f7187e751162b3b84445bbbd79f691"
172+
uuid = "6c6e2e6c-3030-632d-7369-2d6c69616d65"
173+
version = "1.1.0"
25174
26-
md"sum(i^2 for i in 1:N) = $(sum_squares)\n\nprod(i for i in 1:5) = $(prod_small)"
175+
[[deps.Markdown]]
176+
deps = ["Base64"]
177+
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
178+
version = "1.11.0"
179+
180+
[[deps.MbedTLS_jll]]
181+
deps = ["Artifacts", "Libdl"]
182+
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
183+
version = "2.28.6+0"
184+
185+
[[deps.Mmap]]
186+
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
187+
version = "1.11.0"
188+
189+
[[deps.MozillaCACerts_jll]]
190+
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
191+
version = "2023.12.12"
192+
193+
[[deps.NetworkOptions]]
194+
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
195+
version = "1.2.0"
196+
197+
[[deps.OpenBLAS_jll]]
198+
deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"]
199+
uuid = "4536629a-c528-5b80-bd46-f80d51c5b363"
200+
version = "0.3.27+1"
201+
202+
[[deps.Parsers]]
203+
deps = ["Dates", "PrecompileTools", "UUIDs"]
204+
git-tree-sha1 = "7d2f8f21da5db6a806faf7b9b292296da42b2810"
205+
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
206+
version = "2.8.3"
207+
208+
[[deps.Pkg]]
209+
deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "Random", "SHA", "TOML", "Tar", "UUIDs", "p7zip_jll"]
210+
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
211+
version = "1.11.0"
212+
213+
[deps.Pkg.extensions]
214+
REPLExt = "REPL"
215+
216+
[deps.Pkg.weakdeps]
217+
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
218+
219+
[[deps.PlutoUI]]
220+
deps = ["AbstractPlutoDingetjes", "Base64", "ColorTypes", "Dates", "Downloads", "FixedPointNumbers", "Hyperscript", "HypertextLiteral", "IOCapture", "InteractiveUtils", "JSON", "Logging", "MIMEs", "Markdown", "Random", "Reexport", "URIs", "UUIDs"]
221+
git-tree-sha1 = "8329a3a4f75e178c11c1ce2342778bcbbbfa7e3c"
222+
uuid = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
223+
version = "0.7.71"
224+
225+
[[deps.PrecompileTools]]
226+
deps = ["Preferences"]
227+
git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f"
228+
uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
229+
version = "1.2.1"
230+
231+
[[deps.Preferences]]
232+
deps = ["TOML"]
233+
git-tree-sha1 = "0f27480397253da18fe2c12a4ba4eb9eb208bf3d"
234+
uuid = "21216c6a-2e73-6563-6e65-726566657250"
235+
version = "1.5.0"
236+
237+
[[deps.Printf]]
238+
deps = ["Unicode"]
239+
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
240+
version = "1.11.0"
241+
242+
[[deps.Random]]
243+
deps = ["SHA"]
244+
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
245+
version = "1.11.0"
246+
247+
[[deps.Reexport]]
248+
git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b"
249+
uuid = "189a3867-3050-52da-a836-e630ba90ab69"
250+
version = "1.2.2"
251+
252+
[[deps.SHA]]
253+
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
254+
version = "0.7.0"
255+
256+
[[deps.Serialization]]
257+
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
258+
version = "1.11.0"
259+
260+
[[deps.Statistics]]
261+
deps = ["LinearAlgebra"]
262+
git-tree-sha1 = "ae3bb1eb3bba077cd276bc5cfc337cc65c3075c0"
263+
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
264+
version = "1.11.1"
265+
266+
[deps.Statistics.extensions]
267+
SparseArraysExt = ["SparseArrays"]
268+
269+
[deps.Statistics.weakdeps]
270+
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
271+
272+
[[deps.TOML]]
273+
deps = ["Dates"]
274+
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
275+
version = "1.0.3"
276+
277+
[[deps.Tar]]
278+
deps = ["ArgTools", "SHA"]
279+
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
280+
version = "1.10.0"
281+
282+
[[deps.Test]]
283+
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
284+
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
285+
version = "1.11.0"
286+
287+
[[deps.Tricks]]
288+
git-tree-sha1 = "372b90fe551c019541fafc6ff034199dc19c8436"
289+
uuid = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775"
290+
version = "0.1.12"
291+
292+
[[deps.URIs]]
293+
git-tree-sha1 = "bef26fb046d031353ef97a82e3fdb6afe7f21b1a"
294+
uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"
295+
version = "1.6.1"
296+
297+
[[deps.UUIDs]]
298+
deps = ["Random", "SHA"]
299+
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
300+
version = "1.11.0"
301+
302+
[[deps.Unicode]]
303+
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
304+
version = "1.11.0"
305+
306+
[[deps.Zlib_jll]]
307+
deps = ["Libdl"]
308+
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
309+
version = "1.2.13+1"
310+
311+
[[deps.libblastrampoline_jll]]
312+
deps = ["Artifacts", "Libdl"]
313+
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
314+
version = "5.11.0+0"
315+
316+
[[deps.nghttp2_jll]]
317+
deps = ["Artifacts", "Libdl"]
318+
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
319+
version = "1.59.0+0"
320+
321+
[[deps.p7zip_jll]]
322+
deps = ["Artifacts", "Libdl"]
323+
uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"
324+
version = "17.4.0+2"
325+
"""
27326

327+
# ╔═╡ Cell order:
328+
# ╠═43cf38af-b7ca-4491-a592-b0eace48ed79
329+
# ╠═59ad62d3-f9ec-4cb6-bcd6-d89cb24c6a3e
330+
# ╠═83def218-0a73-4808-acbb-47491780a8c3
331+
# ╠═161e535b-b177-4fd3-9968-68e9ebe3909e
332+
# ╟─00000000-0000-0000-0000-000000000001
333+
# ╟─00000000-0000-0000-0000-000000000002

0 commit comments

Comments
 (0)