If I do
using Interact
tb = textbox()
md"Title: $tb"
and then render and display that markdown on a webpage, I end up getting the textbox below the word "Title". Is there a way to interpolate the widget into Markdown in such a way that it doesn't make a new line?
e.g.
julia> using Interact, Blink
julia> tb = textbox();
julia> body!(w, hbox(md"Title: $tb"));
results in
Screen-Shot-2022-02-15-at-1.37.56-PM.png
I know I could write HTML, but I'm trying to figure out how far I can get just writing Markdown instead, since it's so much cleaner
I was just going to say I'd try raw HTML. I think the markdown behavior in question is implementation-dependent, but in general markdown isn't really designed for this kind of specificity.
Fair enough
Pluto has spoiled me for a nice easy experience making and displaying widgets, but not having control over the reactivity and not having a REPL is driving me mad
Regarding your first point about widgets and manual reactivity in Pluto, would wrapping them in confirm work alright? My bad if you've already tried that!
Hm, I actually didn't know about confirm
, but I hacked my way around doing something similar. My problem isn't so much the widgets though, but everything else. The widgets are the part I want to be reactive.
The breaking point for me was when I made a little dashboard for data entry where the you input some data in various reactive textboxes, and then once you click a button, it push!
s some computed data to a DataFrame
. I had been very careful to do a bunch of tricks to make sure Pluto didn't destroy my dataframe while I was building it up, but then at the end of the process after I had spent like 20 minutes inputing data, I I wrote that data to disk, and then did one thing to check to make sure the data was right and a stray side effect caused Pluto to recompute the whole notebook, emptied my intermediate dataframe, and wrote the now empty dataframe to disk, overwriting the previous record I wrote
Now, that example is really one that's just so fundamentally stateful that I shouldn't have expected anything other than disaster trying to do it in pluto, but even in other more tame cases I find myself fighting it so much that I think I'm just done with Pluto for now
Oh man, I've definitely been bitten by that before, sorry that happened to you! I usually get lucky and can just ctrl-z things from my text editor if using auto_reload_from_file
, but I can definitely see how even that still wouldn't save you when doing things like text field input
Last updated: Nov 22 2024 at 04:41 UTC