EasySci commited on
Commit
6a14743
·
1 Parent(s): 88041f6

Update app2.py

Browse files
Files changed (1) hide show
  1. app2.py +14 -13
app2.py CHANGED
@@ -9,7 +9,7 @@ from functools import partial
9
  from src.search import Search_Papers
10
 
11
  class MainBody(param.Parameterized):
12
- main_body = param.List(default=[])
13
 
14
  @param.depends("main_body")
15
  def update(self):
@@ -17,6 +17,8 @@ class MainBody(param.Parameterized):
17
 
18
  main_body_instance = MainBody()
19
 
 
 
20
  def load_categories():
21
  f = open("categories_general.txt", "r")
22
  list_categories = f.read().splitlines()
@@ -57,18 +59,17 @@ def run_code(event):
57
 
58
  def update_mainTLDR():
59
 
60
- # First row of the grid
61
- TLDR = [pn.Row(pn.pane.Markdown("# Cosmology"),
62
- pn.Column(text, text2, sizing_mode='stretch_width'),
63
- pn.Column(text2, text, sizing_mode='stretch_width'),
64
- sizing_mode='stretch_width',
65
- ),
66
- # Second row of the grid
67
- pn.Row(pn.pane.Markdown("# Astrophysics"),
68
- pn.Column(text, text2, sizing_mode='stretch_width'),
69
- sizing_mode='stretch_width',
70
- )]
71
- return TLDR
72
 
73
 
74
  main_body = [pn.Row(pn.pane.Markdown("# Please select some tags!"),
 
9
  from src.search import Search_Papers
10
 
11
  class MainBody(param.Parameterized):
12
+ main_body = param.List(default=[], constant=True)
13
 
14
  @param.depends("main_body")
15
  def update(self):
 
17
 
18
  main_body_instance = MainBody()
19
 
20
+
21
+
22
  def load_categories():
23
  f = open("categories_general.txt", "r")
24
  list_categories = f.read().splitlines()
 
59
 
60
  def update_mainTLDR():
61
 
62
+ if not buttons_to_add:
63
+ return [pn.pane.Markdown("# Please select some tags!")]
64
+
65
+ # Create Markdown content based on the selected categories
66
+ markdown_content = "# Selected Categories\n"
67
+ for category in buttons_to_add:
68
+ markdown_content += f"## {category}\n\n"
69
+ # Add a brief summary of the category (modify as needed)
70
+ markdown_content += f"This is a brief summary of the category: {category}.\n\n"
71
+
72
+ return [pn.pane.Markdown(markdown_content)]
 
73
 
74
 
75
  main_body = [pn.Row(pn.pane.Markdown("# Please select some tags!"),