Payam75 commited on
Commit
8001cbd
·
verified ·
1 Parent(s): 7ed9c77

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -10
app.py CHANGED
@@ -5,8 +5,7 @@ import mistune
5
 
6
  def process(url: str):
7
  """
8
- دریافت لینک وب‌سایت -> استخراج محتوا -> ذخیره در فایل Markdown ->
9
- تولید HTML برای نمایش در رابط کاربری
10
  """
11
  # اجرای تابع وب‌اسکرپر
12
  result = scrape_to_markdown(url)
@@ -27,20 +26,20 @@ def process(url: str):
27
 
28
  # رابط کاربری Gradio
29
  with gr.Blocks(css="style.css") as demo:
30
- gr.Markdown("## 🌐 Web to Markdown Converter")
31
 
32
  with gr.Row():
33
- url_input = gr.Textbox(label="🔗 وارد کردن لینک وب‌سایت", placeholder="https://example.com")
34
- submit_btn = gr.Button("🚀 استخراج محتوا")
35
 
36
  with gr.Tab("📄 Markdown"):
37
- md_output = gr.Textbox(label="محتوای Markdown", lines=20)
38
 
39
- with gr.Tab("💾 دانلود"):
40
- file_output = gr.File(label="دریافت فایل Markdown")
41
 
42
- with gr.Tab("🌍 پیش‌نمایش HTML"):
43
- html_output = gr.HTML(label="نمای HTML")
44
 
45
  submit_btn.click(process, inputs=url_input, outputs=[md_output, file_output, html_output])
46
 
 
5
 
6
  def process(url: str):
7
  """
8
+ Get website link -> Extract content -> Save in Markdown file -> Generate HTML for display in user interface.
 
9
  """
10
  # اجرای تابع وب‌اسکرپر
11
  result = scrape_to_markdown(url)
 
26
 
27
  # رابط کاربری Gradio
28
  with gr.Blocks(css="style.css") as demo:
29
+ gr.Markdown("## 🌐 Web to Markdown Scraper and Converter")
30
 
31
  with gr.Row():
32
+ url_input = gr.Textbox(label="🔗 Enter the website link", placeholder="https://example.com")
33
+ submit_btn = gr.Button("🔥 Content Extraction")
34
 
35
  with gr.Tab("📄 Markdown"):
36
+ md_output = gr.Textbox(label="Markdown Content", lines=20)
37
 
38
+ with gr.Tab("💾 Download"):
39
+ file_output = gr.File(label="Download Markdown file")
40
 
41
+ with gr.Tab("🌍 Preview HTML"):
42
+ html_output = gr.HTML(label="HTML View")
43
 
44
  submit_btn.click(process, inputs=url_input, outputs=[md_output, file_output, html_output])
45