Skip to content

Commit

Permalink
Make fake_bind compatible to runic.
Browse files Browse the repository at this point in the history
  • Loading branch information
j-fu committed Nov 25, 2024
1 parent 84b9f1f commit e56e4fb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/runner/PlutoRunner/src/bonds.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,16 @@ end

"""
Will be inserted in saved notebooks that use the @bind macro, make sure that they still contain legal syntax when executed as a vanilla Julia script. Overloading `Base.get` for custom UI objects gives bound variables a sensible value.
Also turns off JuliaFormatter formatting to avoid issues with the formatter trying to change code that the user does not control. See https://domluna.github.io/JuliaFormatter.jl/stable/#Turn-off/on-formatting
Also turns off Runic and JuliaFormatter formatting to avoid issues with the formatter trying to change code that the user does not control. See https://domluna.github.io/JuliaFormatter.jl/stable/#Turn-off/on-formatting or https://github.com/fredrikekre/Runic.jl?tab=readme-ov-file#toggle-formatting
"""
const fake_bind = """macro bind(def, element)
#! format: off
const fake_bind = """#! format: off
macro bind(def, element)
quote
local iv = try Base.loaded_modules[Base.PkgId(Base.UUID("6e696c72-6542-2067-7265-42206c756150"), "AbstractPlutoDingetjes")].Bonds.initial_value catch; b -> missing; end
local el = \$(esc(element))
global \$(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : iv(el)
el
end
#! format: on
end"""
end
#! format: on"""

0 comments on commit e56e4fb

Please sign in to comment.