Open lukavdplas opened 4 months ago
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
This can be caused by docstrings + @htl
macro (as in https://github.com/fonsp/Pluto.jl/issues/2811) ?
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
.
Indeed, the combination of docstrings and @htl
seems to cause the issue!
Here is that notebook after I open it:
After I change the return value of the function:
So the issue is:
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)