JuliaGizmos / Interact.jl

Interactive widgets to play with your Julia code
Other
522 stars 77 forks source link

Mixing markdown and Interact.jl removes all html rendering. #376

Closed janrpeters closed 3 years ago

janrpeters commented 3 years ago

Mixing markdown and Interact.jl removes all html rendering. Here is my code

function app(req)
    mymarkdown = md"""
# Hello, Markdown!
## Lorem ipsum

* Point 1
* Point 2

Cauchy-Schwartz inequality:

$$\left(\sum_{k=1}^n a_k b_k \right)^2 \leq
  \left(\sum_{k=1}^n a_k^2 \right)  \left(\sum_{k=1}^n b_k^2 \right)$$"""

    el = @manipulate for A=0.1:0.2:3
        x=0:0.01:2*π;
        y=sin.(A*x);
        plot(x,y)
    end

    return Node(:div, Node(:div,pad(1em, mymarkdown)(background("#fff1f0"))),
                      Node(:div,pad(1em, el)(background("#fff1f0"))))
end

In Jupyter all looks perfectly!

image

Without the interact.jl code (variable el), the Markdown is rendered nicely even using webio_serve(page("/", app), 8000) by when adding el=@manipulate... it all formatting is lost.

image

Is there any WebIO or Interact.jl specialist here?

janrpeters commented 3 years ago

The problem is the same on Blink!

image

janrpeters commented 3 years ago

settheme!(:nativehtml) solves this problem!