-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into details-css
- Loading branch information
Showing
9 changed files
with
141 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "PlutoUI" | ||
uuid = "7f904dfe-b85e-4ff6-b463-dae2292396a8" | ||
authors = ["Fons van der Plas <[email protected]>"] | ||
version = "0.7.56" | ||
version = "0.7.60" | ||
|
||
[deps] | ||
AbstractPlutoDingetjes = "6e696c72-6542-2067-7265-42206c756150" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,5 +79,6 @@ end | |
|
||
|
||
include("./ScrubbableMatrix.jl") | ||
include("./bindname.jl") | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import HypertextLiteral | ||
|
||
""" | ||
```julia | ||
@bindname name Slider(1:10) | ||
``` | ||
Like `@bind` in Pluto, but it also displays the name of the variable before the input widget. | ||
""" | ||
macro bindname(name::Symbol, ex::Expr) | ||
|
||
# Some macro magic to call the `@bind` macro without hygiene. This will use whatever `@bind` is defined in the scope of the caller of this macro. | ||
# We could just do `Main.PlutoRunner.@bind`, but then if you run the notebook.jl as a standalone script, it does not find the mock `@bind`. | ||
bindcall = Expr(:macrocall, | ||
Symbol("@bind"), | ||
__source__, | ||
name, | ||
ex | ||
) | ||
|
||
# Messy HTML to avoid unintended whitespace, which can show up in rare cases. | ||
quote | ||
bond = $(esc(bindcall)) | ||
|
||
HypertextLiteral.@htl( | ||
"""<div style='display: flex; flex-wrap: wrap; align-items: baseline;'><code style='color: var(--cm-color-var) !important; font-weight: 700;'>$( | ||
$(String(name)) | ||
) <span style="opacity: .6">=</span> </code>$( | ||
bond | ||
)</div>""" | ||
) | ||
end | ||
end | ||
|
||
export @bindname |