MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _build_scholar_html

Function _build_scholar_html

experiments/tests/test_profile_bootstrap.py:33–109  ·  view source on GitHub ↗
(publications=None, *, stats=None, interests=None, homepage_url=None)

Source from the content-addressed store, hash-verified

31
32
33def _build_scholar_html(publications=None, *, stats=None, interests=None, homepage_url=None) -> str:
34 publications = publications or [
35 {
36 "title": "GUI Agent Infrastructure for Scientific Discovery",
37 "authors": "Ada Example, John Doe",
38 "venue": "Nature Machine Intelligence",
39 "citations": 128,
40 "year": 2025,
41 },
42 {
43 "title": "Protein Language Models for Molecular Design",
44 "authors": "Ada Example, Jane Roe",
45 "venue": "ICLR",
46 "citations": 64,
47 "year": 2024,
48 },
49 ]
50 stats = stats or {"Citations": 1024, "h-index": 21}
51 interests = interests or [
52 "GUI Agent",
53 "Protein Language Model",
54 "Scientific Discovery",
55 ]
56
57 publication_rows = []
58 for index, publication in enumerate(publications, start=1):
59 publication_rows.append(
60 f"""
61 <tr class="gsc_a_tr">
62 <td class="gsc_a_t">
63 <a class="gsc_a_at" href="/citations?view_op=view_citation&citation_for_view=test:{index}">
64 {publication['title']}
65 </a>
66 <div class="gs_gray">{publication['authors']}</div>
67 <div class="gs_gray">{publication['venue']}</div>
68 </td>
69 <td class="gsc_a_c"><a class="gsc_a_ac" href="/citations?view_op=view_citation&citation_for_view=test:{index}">{publication['citations']}</a></td>
70 <td class="gsc_a_y"><span class="gsc_a_h">{publication['year']}</span></td>
71 </tr>
72 """
73 )
74
75 stats_rows = []
76 for label, value in stats.items():
77 stats_rows.append(
78 f"""
79 <tr>
80 <td class="gsc_rsb_sc1">{label}</td>
81 <td class="gsc_rsb_std">{value}</td>
82 </tr>
83 """
84 )
85
86 homepage_html = (
87 f'<a class="gsc_prf_ila" href="{homepage_url}">{homepage_url}</a>'
88 if homepage_url
89 else ""
90 )

Calls

no outgoing calls

Tested by

no test coverage detected