Spaces:
Sleeping
Sleeping
File size: 380 Bytes
4a5a872 9d363ed 4a5a872 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import gradio as gr
mf={
"Heading1":"#",
"Heading2":"##",
"Heading3":"###",
}
def upd(inp,format):
line=mf[format]+inp
return line
with gr.Blocks() as app:
format=gr.Dropdown(label="Line Format",choices=[m for m in list(mf.keys())])
txt=gr.Textbox()
btn=gr.Button()
prev=gr.Markdown("# test")
btn.click(upd,[txt,format],prev)
app.launch() |