You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was working on a notebook that creates a function with HypertextLiteral.Result output. This is intended to create an interactive HTML element with Javascript.
functionmybutton()
return@htl""" <div> <button>I'm a button!</button> <script> var parent = currentScript.parentElement; var button = parent.querySelector("button"); button.addEventListener("click", (e) => { button.innerText = "I have been clicked!" }); </script> </div>"""end
The linked notebook defines two such functions MapPicker() and MapPickerMultiple(), which follow the same principle as the example above, but with much bigger functions.
The issue I encountered is that when I update the HTML (or Javascript) in the function body of MapPicker() or MapPickerMultiple(), the cell with the function call (@bind place MapPicker()) does not seem to re-run. It still shows the "old" version of the output. I need to manually hit Shift + Enter in the cell with the function call to get it to update.
Strangely enough, the dependency also seems broken in the other direction, The notebook contains a cell that defines a struct TileLayer, that is used in the body of MapPicker() and MapPickerMultiple(), and one "normal" Julia cell. When I rename TileLayer so any references to it should break, the "normal" cell" immediately shows an error, but the cells defining MapPicker() and MapPickerMultiple() don't react until I use Shift + Enter to rerun them.
Another weird issue that may or may not be related is that re-running the cell with the function definition for MapPickerMultiple() seems to somehow cause duplicates in the cell output that shows the docstring:
I encountered this in a different notebook a few weeks ago, which had a similar structure: a function that defines a sizable HypertextLiteral.Result. So it doesn't seem to be a one-off, but both notebooks were written by me, so they might have the same "quirk".
(I am using: Pluto, v0.19.38 / Julia 1.6)
The text was updated successfully, but these errors were encountered:
Ah, yes, it looks like the issue reported there is caused by the same underlying issue. I'll check if I can get a minimum working example by combining docstrings + @htl.
the text in the cell calling myhypertext() hasn't updated.
Thanks, this at least helped me find a work-around: you can comment out docstrings while working on the body of the function. That's not really a fix, just a tip for anyone else running into the same issue.
I was working on a notebook that creates a function with
HypertextLiteral.Result
output. This is intended to create an interactive HTML element with Javascript.A minimal version is something like this:
https://gist.github.com/lukavdplas/ebf28806752fba4cb999e0e3c573dc1a
where there is a cell
and a cell
I'm adding this simplified version for the sake of clarity, but I could not replicate the issue there. The actual notebook is this one: https://github.com/lukavdplas/PlutoMapPicker.jl/blob/main/src/map-picker.jl
The linked notebook defines two such functions
MapPicker()
andMapPickerMultiple()
, which follow the same principle as the example above, but with much bigger functions.The issue I encountered is that when I update the HTML (or Javascript) in the function body of
MapPicker()
orMapPickerMultiple()
, the cell with the function call (@bind place MapPicker()
) does not seem to re-run. It still shows the "old" version of the output. I need to manually hit Shift + Enter in the cell with the function call to get it to update.Strangely enough, the dependency also seems broken in the other direction, The notebook contains a cell that defines a struct
TileLayer
, that is used in the body ofMapPicker()
andMapPickerMultiple()
, and one "normal" Julia cell. When I renameTileLayer
so any references to it should break, the "normal" cell" immediately shows an error, but the cells definingMapPicker()
andMapPickerMultiple()
don't react until I use Shift + Enter to rerun them.Another weird issue that may or may not be related is that re-running the cell with the function definition for
MapPickerMultiple()
seems to somehow cause duplicates in the cell output that shows the docstring:I encountered this in a different notebook a few weeks ago, which had a similar structure: a function that defines a sizable
HypertextLiteral.Result
. So it doesn't seem to be a one-off, but both notebooks were written by me, so they might have the same "quirk".(I am using: Pluto, v0.19.38 / Julia 1.6)
The text was updated successfully, but these errors were encountered: