Spaces:
Runtime error
Runtime error
File size: 1,557 Bytes
2b89b02 b914562 2b89b02 b914562 2b89b02 b914562 0dc6e48 2b89b02 |
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
import gradio as gr
def get_text() -> str:
return """\
# Hello Refinaid Markdown Parser
This is a markdown parser that will help you to summerize your ticket content.
- Author: [Hugo ChunHo Lin](https://github.com/1chooo)
- Date: 2024-04-30
- Version: v0.0.1
## Code Snippet
```python
def hello():
print("Hello, Refinaid!")
if __name__ == "__main__":
hello()
```
## Math Formula
$$ f(x) = x^2 + 2x + 1 $$
## Table
| Name | Age |
|------|-----|
| Hugo | 22 |
## Image

## List
- Item 1
- Item 2
## Quote
> "The only way to do great work is to love what you do." - Steve Jobs
## Task List
- [x] Task 1
- [ ] Task 2
## Reference
- [refinaid/gradio-playground/markdown-parser](https://github.com/refinaid/gradio-playground)
"""
def render_preview(summerized_ticket_conent: str) -> str:
return summerized_ticket_conent
with gr.Blocks(
title='Refinaid Markdown Parser',
) as demo:
gr.HTML(
"<h1 align=center>Refinaid Markdown Parser</h1>"
)
with gr.Row():
summerized_ticket_conent = gr.Textbox(
interactive=True,
label="π Summerized Ticket Content",
render=True,
value=get_text(),
)
prev_summerized_ticket_content = gr.Markdown(
value=get_text(),
)
summerized_ticket_conent.change(
fn=render_preview,
inputs=summerized_ticket_conent,
outputs=prev_summerized_ticket_content,
)
demo.launch()
|