stlite icon indicating copy to clipboard operation
stlite copied to clipboard

Custom element syntax

Open whitphx opened this issue 1 year ago • 0 comments

Found that the JS-based syntax has one clear downside that developers have to take care of escaping some characters such as backtick (`) and backslash (\). Ref: https://github.com/whitphx/stlite/blob/db36554dfcc98d1fa53d6d90725ab061e46ae159/packages/sharing-editor/src/export/html.ts#L13-L18

Custom element syntax like below allows developers to write the Python code without such cares.

<stlite-app>
import streamlit as st

st.write("Hello World")
</stlite-app>

whitphx avatar Apr 24 '24 02:04 whitphx