Omnibus's picture
Update app.py
9d363ed verified
raw
history blame
380 Bytes
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()