EasySci commited on
Commit
7d285fb
·
1 Parent(s): 4abbe3f

Update TLDR.py

Browse files
Files changed (1) hide show
  1. TLDR.py +4 -4
TLDR.py CHANGED
@@ -52,13 +52,13 @@ def update_mainTLDR(buttons_to_add, paper_list):
52
  category_content = []
53
  category_title = f"{buttons_to_add[i]}"
54
  anchor_id = category_title.lower().replace(" ", "-") # Generate anchor ID from the title
55
- table_of_contents.append(f"- [{category_title}](#{anchor_id}{{.anchor}})") # Add the anchor class to the link
56
 
57
  for paper in paper_list[i]:
58
 
59
  # Create the HTML content for both links with line breaks
60
  html_content = (
61
- f'<a class="anchor" href="#{anchor_id}">{paper.entry_id}</a>'
62
  f' - <a href="{paper.pdf_url}" target="_blank">PDF</a>'
63
  f' - {(paper.published).strftime("%d/%m/%Y %H:%M:%S")}'
64
  )
@@ -72,7 +72,7 @@ def update_mainTLDR(buttons_to_add, paper_list):
72
  category_content.append(paper_content)
73
 
74
  category_column = pn.Column(
75
- pn.pane.Markdown(f"## [{category_title}](#{anchor_id}{{.anchor}})"), # Add Markdown link with anchor ID to the category title
76
  pn.layout.Spacer(height=20),
77
  *category_content,
78
  pn.layout.Spacer(height=10),
@@ -92,4 +92,4 @@ def update_mainTLDR(buttons_to_add, paper_list):
92
  else:
93
  main_tldr.append(pn.pane.Markdown("# Please select some tags!"))
94
 
95
- return main_tldr
 
52
  category_content = []
53
  category_title = f"{buttons_to_add[i]}"
54
  anchor_id = category_title.lower().replace(" ", "-") # Generate anchor ID from the title
55
+ table_of_contents.append(f"- [{category_title}](#{anchor_id})")
56
 
57
  for paper in paper_list[i]:
58
 
59
  # Create the HTML content for both links with line breaks
60
  html_content = (
61
+ f'<a href="{paper.entry_id}" target="_blank">{paper.entry_id}</a>'
62
  f' - <a href="{paper.pdf_url}" target="_blank">PDF</a>'
63
  f' - {(paper.published).strftime("%d/%m/%Y %H:%M:%S")}'
64
  )
 
72
  category_content.append(paper_content)
73
 
74
  category_column = pn.Column(
75
+ pn.pane.HTML(f'<a id="{anchor_id}">{category_title}</a>'), # Create anchor without href for the category title
76
  pn.layout.Spacer(height=20),
77
  *category_content,
78
  pn.layout.Spacer(height=10),
 
92
  else:
93
  main_tldr.append(pn.pane.Markdown("# Please select some tags!"))
94
 
95
+ return main_tldr