widgetti / solara

A Pure Python, React-style Framework for Scaling Your Jupyter and Web Apps
https://solara.dev
MIT License
1.76k stars 131 forks source link

Jupyter notebook export to HTML #259

Open FernandoFerrerTDK opened 10 months ago

FernandoFerrerTDK commented 10 months ago

Hello! I'm new to Solara. I'm trying to make an interactive report converting a Jupyter notebook to HTML. Nevertheless when performing the export with jupyter nbconvert --to html, Solara components do not appear in the resulting HTML file.

I'm using the basic example from the tutorial:

import solara

clicks = solara.reactive(0)

@solara.component
def Page():
    def increase_clicks():
        clicks.value += 1

    solara.Button(label=f"Clicked {clicks} times", on_click=increase_clicks)

# in the Jupyter notebook, uncomment the next line:
display(Page())

Is there any setting to consider for HTML exports of Jupyter Notebooks?

Thanks in advance!

maartenbreddels commented 10 months ago

Hi,

I think this should work. Did you try with regular ipywidgets? Does that work?

Regards,

Maarten