Skip to content

Commit

Permalink
Update advanced-widgets.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Apr 24, 2024
1 parent 05906b5 commit 379b21c
Showing 1 changed file with 26 additions and 37 deletions.
63 changes: 26 additions & 37 deletions src/en/docs/advanced-widgets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ Pluto has a number of advanced features for developers who want to create comple
"""

# ╔═╡ 80020cac-56d9-4a5b-9959-e61c7042d900
TableOfContents(include_definitions=true)

# ╔═╡ 41fd552d-35bd-4be6-b103-116f4bcd4998
md"""
Expand Down Expand Up @@ -243,34 +246,6 @@ Pluto can be used as a framework to have high-quality widgets powered by JavaScr
Techniques used to power Custom Outputs can also be used in **Custom Inputs**! A Custom Input is just a Custom Output with added `@bind` support.
DONE:
```
currentScript
value
```
TODO:
```
OBject.definepropeorty(div, "value", {})
this and id
returning DOM element from script
invalidation
observable API
getBoundElementValueLikePluto
setBoundElementValueLikePluto
getBoundElementEventNameLikePluto
getNotebookMetadataExperimental
setNotebookMetadataExperimental
deleteNotebookMetadataExperimental
getCellMetadataExperimental
setCellMetadataExperimental
deleteCellMetadataExperimental
```
"""

# ╔═╡ e733647f-5af9-462c-9bb6-ef4282a04f6c
Expand All @@ -287,6 +262,20 @@ md"""
TODO. See `PlutoUI.ExperimentalLayout`
"""

# ╔═╡ ff138461-4ce0-4c2c-b5c4-e90d8f53759a
md"""
## JavaScript API
`<script>` tags included in HTML output will be executed by Pluto, and you can use this to make interactive and dynamic widgets! In your code, you will mostly be using **Web APIs** (your code runs directly in the browser), like DOM manipulation. Use [javascript.info](https://javascript.info) or [MDN](https://developer.mozilla.org/) to learn more about Web APIs. You can also import JavaScript libraries and frameworks and use them in your widget.
We think the Web APIs and modern JavaScript are very powerful, and you should be able to do anything you want! However, we decided to add a **small amount of extra functionality** to make it easier to write code specifically for Pluto outputs.
"""

# ╔═╡ d36015bc-b8dc-458c-b5df-011accb09d12
html"""
<a href="https://plutojl.org/en/docs/javascript-api/" class="arrow">Learn more: JavaScript API</a>
"""

# ╔═╡ 0fcf5330-b9b6-4ebc-819d-c8860353a61d
md"""
## `AbstractPlutoDingetjes.Display`
Expand All @@ -309,12 +298,9 @@ let y = \$(AbstractPlutoDingetjes.Display.published_to_js(my_big_vector))
"""

# ╔═╡ 189cfef6-7bfb-4181-8d7a-3086324968f2
md"""
## `AbstractPlutoDingetjes.Display.with_js_link`
Use `AbstractPlutoDingetjes.Display.with_js_link` when you want to make on-demand requests to Julia from your JavaScript code.
# ╔═╡ ae310b31-92d4-49ce-bff8-5f51fea6afc8
html"""
<a href="https://plutojl.org/en/docs/abstractplutodingetjes/" class="arrow">Learn more: AbstractPlutoDingetjes</a>
"""

# ╔═╡ 965e17ea-cc2c-4072-82c4-94f259ce9224
Expand Down Expand Up @@ -357,8 +343,8 @@ Docs.Binding(AbstractPlutoDingetjes.Display, :published_to_js)
# ╔═╡ 2320e06c-56f8-47ac-b532-a85ae2cbe3f5
Docs.Binding(AbstractPlutoDingetjes.Display, :with_js_link)

# ╔═╡ 80020cac-56d9-4a5b-9959-e61c7042d900
TableOfContents(include_definitions=true)
# ╔═╡ 3775fb8c-ec06-4482-9b0e-a4c1aa32afb7
Docs.Binding(AbstractPlutoDingetjes, :is_supported_by_display)

# ╔═╡ 00000000-0000-0000-0000-000000000001
PLUTO_PROJECT_TOML_CONTENTS = """
Expand Down Expand Up @@ -666,10 +652,13 @@ version = "17.4.0+2"
# ╟─547f90c5-f8de-4a1c-9b9e-25bf8c78161e
# ╠═e733647f-5af9-462c-9bb6-ef4282a04f6c
# ╠═b6b9a299-0d70-430c-8bf5-d10014261f27
# ╟─ff138461-4ce0-4c2c-b5c4-e90d8f53759a
# ╟─d36015bc-b8dc-458c-b5df-011accb09d12
# ╟─0fcf5330-b9b6-4ebc-819d-c8860353a61d
# ╟─0fff3ea7-74a5-4bd5-a205-db21b23a2601
# ╟─189cfef6-7bfb-4181-8d7a-3086324968f2
# ╟─2320e06c-56f8-47ac-b532-a85ae2cbe3f5
# ╟─3775fb8c-ec06-4482-9b0e-a4c1aa32afb7
# ╟─ae310b31-92d4-49ce-bff8-5f51fea6afc8
# ╟─965e17ea-cc2c-4072-82c4-94f259ce9224
# ╠═a17a8282-05f6-469d-9579-63029db89f79
# ╠═e5a05101-a023-40ad-9bef-c6c8d18eb719
Expand Down

0 comments on commit 379b21c

Please sign in to comment.