Skip to content

Commit 1d8495b

Browse files
dweindldilpath
andauthored
pages: replace URLs by icons (#267)
* pages: replace URLs by icons Make the table a bit less crowded. :eyes: https://benchmarking-initiative.github.io/Benchmark-Models-PEtab/ * Update src/python/benchmark_models_petab/overview.py Co-authored-by: Dilan Pathirana <[email protected]> --------- Co-authored-by: Dilan Pathirana <[email protected]>
1 parent c8af5a6 commit 1d8495b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/python/benchmark_models_petab/overview.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,8 @@ def get_formatter(col: str):
363363
)
364364
if pd.api.types.is_integer_dtype(df[col].dtype):
365365
return NumberFormatter(text_align="right")
366-
if col in ["reference_uris", "sbml4humans_urls"]:
366+
if col in ("reference_uris", "sbml4humans_urls"):
367+
icon = "📚" if col == "reference_uris" else "🌠"
367368
return HTMLTemplateFormatter(
368369
template="""
369370
<%
@@ -376,9 +377,9 @@ def get_formatter(col: str):
376377
}
377378
for (let i = 0; i < urls.length; i++) {
378379
%>
379-
<a href="<%= urls[i] %>" target="_blank"><%= urls[i] %></a>
380+
<a href="<%= urls[i] %>" target="_blank">LINK_TEXT</a>
380381
<% } %>
381-
"""
382+
""".replace("LINK_TEXT", icon)
382383
)
383384

384385
return StringFormatter()

0 commit comments

Comments
 (0)