Commit
·
e64fb41
1
Parent(s):
33174dd
fix: update paper title section and links in interface
Browse files- interface.py +12 -5
interface.py
CHANGED
@@ -24,7 +24,7 @@ def format_paper_info(article):
|
|
24 |
|
25 |
info = []
|
26 |
# Title section
|
27 |
-
info.append(f"<h2 class='sf-paper-title'>{article.title or 'Untitled Paper'}</h2>")
|
28 |
info.append(f"<p style='text-align: center'>")
|
29 |
info.append(f"<a href='https://huggingface.co/papers/{article.paper.id}' target='_blank' class='sf-button'>Hugging Face{assets.SVG_LINK}</a>")
|
30 |
info.append(f"<a href='https://arxiv.org/abs/{article.paper.id}' target='_blank' class='sf-button'>arXiv{assets.SVG_LINK}</a>")
|
@@ -88,7 +88,7 @@ def generate_table_html(papers):
|
|
88 |
paper_id = article.paper.id
|
89 |
|
90 |
# 构造 arXiv abs 链接
|
91 |
-
arxiv_abs_link = f"https://
|
92 |
|
93 |
row = f"""
|
94 |
<tr>
|
@@ -108,9 +108,9 @@ def generate_table_html(papers):
|
|
108 |
def build_html(papers):
|
109 |
# Convert all papers to an HTML string, each paper wrapped in a div, with the div containing the paper's information, and the div's id being the paper's id
|
110 |
html = ""
|
111 |
-
for article in papers:
|
112 |
article_html = format_paper_info(article)
|
113 |
-
html += f"<div id='smartflow-paper-{article.paper.id.replace('.', '-')}' style='display: none'>{article_html}</div>"
|
114 |
return html
|
115 |
|
116 |
|
@@ -163,7 +163,14 @@ img.sf-author {
|
|
163 |
margin: 0 0.1rem;
|
164 |
}
|
165 |
|
166 |
-
#paper-detail-area {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
#query-results-html { min-height: 100px; }
|
168 |
"""
|
169 |
|
|
|
24 |
|
25 |
info = []
|
26 |
# Title section
|
27 |
+
info.append(f"<h2 class='sf-paper-title' id='sf-flag'>{article.title or 'Untitled Paper'}</h2>")
|
28 |
info.append(f"<p style='text-align: center'>")
|
29 |
info.append(f"<a href='https://huggingface.co/papers/{article.paper.id}' target='_blank' class='sf-button'>Hugging Face{assets.SVG_LINK}</a>")
|
30 |
info.append(f"<a href='https://arxiv.org/abs/{article.paper.id}' target='_blank' class='sf-button'>arXiv{assets.SVG_LINK}</a>")
|
|
|
88 |
paper_id = article.paper.id
|
89 |
|
90 |
# 构造 arXiv abs 链接
|
91 |
+
arxiv_abs_link = f"https://huggingface.co/papers/{paper_id}"
|
92 |
|
93 |
row = f"""
|
94 |
<tr>
|
|
|
108 |
def build_html(papers):
|
109 |
# Convert all papers to an HTML string, each paper wrapped in a div, with the div containing the paper's information, and the div's id being the paper's id
|
110 |
html = ""
|
111 |
+
for index, article in enumerate(papers):
|
112 |
article_html = format_paper_info(article)
|
113 |
+
html += f"<div id='smartflow-paper-{article.paper.id.replace('.', '-')}' style='{'' if index == 0 else 'display: none'}'>{article_html}</div>"
|
114 |
return html
|
115 |
|
116 |
|
|
|
163 |
margin: 0 0.1rem;
|
164 |
}
|
165 |
|
166 |
+
#paper-detail-area {
|
167 |
+
display: none;
|
168 |
+
}
|
169 |
+
|
170 |
+
#paper-detail-area:has(#sf-flag) {
|
171 |
+
display: block;
|
172 |
+
}
|
173 |
+
|
174 |
#query-results-html { min-height: 100px; }
|
175 |
"""
|
176 |
|