EasySci commited on
Commit
bc0459e
·
1 Parent(s): 3a5fa89

Update TLDR.py

Browse files
Files changed (1) hide show
  1. TLDR.py +8 -9
TLDR.py CHANGED
@@ -44,12 +44,13 @@ def run_code(category, loaded_dict, event = None):
44
 
45
 
46
  def update_mainTLDR(buttons_to_add, paper_list):
47
- main_column = pn.Column()
48
 
49
  if buttons_to_add:
50
  for i in range(len(buttons_to_add)):
51
  category_content = []
52
  for paper in paper_list[i]:
 
53
  # Create the HTML content for both links with line breaks
54
  html_content = (
55
  f'<a href="{paper.entry_id}" target="_blank">{paper.entry_id}</a>'
@@ -58,24 +59,22 @@ def update_mainTLDR(buttons_to_add, paper_list):
58
  )
59
 
60
  paper_content = pn.Column(
61
- pn.pane.LaTeX(f"{paper.title}", styles={'font-size': '16pt', 'font-weight': 'bold'}),
62
  pn.pane.HTML(html_content, styles={'font-size': '12pt'}),
63
  pn.pane.LaTeX(paper.summary, styles={'font-size': '14pt'}),
64
  sizing_mode='stretch_width'
65
  )
66
  category_content.append(paper_content)
67
 
68
- # Create a new column for each category
69
- category_column = pn.Column(
70
- pn.pane.LaTeX(f"{buttons_to_add[i]}", styles={'font-size': '20pt', 'font-weight': 'bold'}),
71
  *category_content,
72
  sizing_mode='stretch_width'
73
  )
74
 
75
- # Add the category column to the main_column
76
- main_column.append(category_column)
77
 
78
  else:
79
- main_column.append(pn.pane.Markdown("# Please select some tags!"))
80
 
81
- return main_column
 
44
 
45
 
46
  def update_mainTLDR(buttons_to_add, paper_list):
47
+ main_tldr = []
48
 
49
  if buttons_to_add:
50
  for i in range(len(buttons_to_add)):
51
  category_content = []
52
  for paper in paper_list[i]:
53
+
54
  # Create the HTML content for both links with line breaks
55
  html_content = (
56
  f'<a href="{paper.entry_id}" target="_blank">{paper.entry_id}</a>'
 
59
  )
60
 
61
  paper_content = pn.Column(
62
+ pn.pane.LaTeX(f"{paper.title}", styles={'font-size': '16pt', 'font-weight':'bold'}),
63
  pn.pane.HTML(html_content, styles={'font-size': '12pt'}),
64
  pn.pane.LaTeX(paper.summary, styles={'font-size': '14pt'}),
65
  sizing_mode='stretch_width'
66
  )
67
  category_content.append(paper_content)
68
 
69
+ category_column = pn.Row(
70
+ pn.pane.LaTeX(f"{buttons_to_add[i]}", styles={'font-size': '20pt', 'font-weight':'bold'}),
 
71
  *category_content,
72
  sizing_mode='stretch_width'
73
  )
74
 
75
+ main_tldr.append(category_column)
 
76
 
77
  else:
78
+ main_tldr.append(pn.pane.Markdown("# Please select some tags!"))
79
 
80
+ return main_tldr