File size: 643 Bytes
45cf63a
16dedd7
 
 
abe5d4c
 
45cf63a
 
abe5d4c
 
 
 
 
 
 
 
45cf63a
abe5d4c
 
 
 
 
45cf63a
abe5d4c
 
 
 
 
45cf63a
abe5d4c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# pdf_viewer_app.py
import gradio as gr


def render_markdown(text: str):
    return text or ""


if __name__ == "__main__":
    with gr.Blocks() as demo:
        input_md = gr.Textbox(
            label="Input",
            placeholder="Type Markdown/LaTeX here...",
            lines=12,
        )
        render_btn = gr.Button("Render", variant="primary")

        md = gr.Markdown(
            label="Markdown rendering",
            show_copy_button=True,
            line_breaks=True,
        )

        render_btn.click(
            fn=render_markdown,
            inputs=input_md,
            outputs=md,
        )

    demo.launch()