Skip to content

Commit 53becb1

Browse files
CopilotSteriva
andauthored
Add static paper wrapper index
Agent-Logs-Url: https://github.com/ERMETE-Lab/Papers-with-code/sessions/2dbc3ce7-7212-4dba-a1b4-65f43215d082 Co-authored-by: Steriva <63815224+Steriva@users.noreply.github.com>
1 parent fe63a03 commit 53becb1

4 files changed

Lines changed: 211 additions & 1 deletion

File tree

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,25 @@
1-
# Papers-with-code
1+
# Papers with code
2+
3+
This repository is a lightweight wrapper for journal papers that link to code
4+
hosted in other repositories in the `ERMETE-Lab` organization.
5+
6+
## Repository layout
7+
8+
- `index.html` renders a simple browser-based index of papers and linked code
9+
repositories.
10+
- `papers.json` stores the paper metadata that drives the index.
11+
- `repositories/` is reserved for the git submodules that mirror the linked
12+
repositories inside this wrapper repository.
13+
14+
## Adding a paper entry
15+
16+
1. Add the target repository as a git submodule under `repositories/<name>`.
17+
2. Add a matching entry to `papers.json` with:
18+
- `title`
19+
- `repository`
20+
- `repository_url`
21+
- `submodule_path`
22+
- optional `journal`, `year`, and `notes`
23+
24+
Until entries are added, the wrapper renders an empty-state message instead of
25+
an empty table.

index.html

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>ERMETE-Lab Papers with code</title>
7+
<style>
8+
:root {
9+
color-scheme: light dark;
10+
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
11+
sans-serif;
12+
}
13+
14+
body {
15+
margin: 0;
16+
padding: 2rem;
17+
background: #f6f8fa;
18+
color: #24292f;
19+
}
20+
21+
main {
22+
max-width: 960px;
23+
margin: 0 auto;
24+
}
25+
26+
h1 {
27+
margin-top: 0;
28+
}
29+
30+
.lead {
31+
margin-bottom: 1.5rem;
32+
}
33+
34+
.empty-state,
35+
table {
36+
width: 100%;
37+
background: #ffffff;
38+
border: 1px solid #d0d7de;
39+
border-radius: 0.5rem;
40+
box-shadow: 0 1px 2px rgba(31, 35, 40, 0.04);
41+
}
42+
43+
.empty-state {
44+
padding: 1.5rem;
45+
box-sizing: border-box;
46+
}
47+
48+
table {
49+
border-collapse: collapse;
50+
overflow: hidden;
51+
}
52+
53+
th,
54+
td {
55+
padding: 0.9rem;
56+
text-align: left;
57+
vertical-align: top;
58+
border-bottom: 1px solid #d8dee4;
59+
}
60+
61+
tr:last-child td {
62+
border-bottom: 0;
63+
}
64+
65+
th {
66+
background: #f6f8fa;
67+
}
68+
69+
code {
70+
font-size: 0.9em;
71+
}
72+
73+
a {
74+
color: #0969da;
75+
}
76+
77+
@media (prefers-color-scheme: dark) {
78+
body {
79+
background: #0d1117;
80+
color: #e6edf3;
81+
}
82+
83+
.empty-state,
84+
table {
85+
background: #161b22;
86+
border-color: #30363d;
87+
}
88+
89+
th,
90+
td {
91+
border-bottom-color: #30363d;
92+
}
93+
94+
th {
95+
background: #0d1117;
96+
}
97+
98+
a {
99+
color: #58a6ff;
100+
}
101+
}
102+
</style>
103+
</head>
104+
<body>
105+
<main>
106+
<h1>ERMETE-Lab papers with code</h1>
107+
<p class="lead">
108+
Journal papers are listed here together with the ERMETE-Lab repository
109+
that contains the related implementation.
110+
</p>
111+
<div id="content" class="empty-state">Loading paper index…</div>
112+
</main>
113+
<script>
114+
const content = document.getElementById("content");
115+
116+
function renderEmptyState(message) {
117+
content.className = "empty-state";
118+
content.textContent = message;
119+
}
120+
121+
function renderTable(papers) {
122+
const rows = papers
123+
.map(
124+
(paper) => `
125+
<tr>
126+
<td>
127+
<strong>${paper.title}</strong>
128+
${paper.journal ? `<div>${paper.journal}</div>` : ""}
129+
${paper.year ? `<div>${paper.year}</div>` : ""}
130+
</td>
131+
<td>
132+
<a href="${paper.repository_url}">${paper.repository}</a>
133+
</td>
134+
<td><code>${paper.submodule_path}</code></td>
135+
<td>${paper.notes ?? ""}</td>
136+
</tr>
137+
`,
138+
)
139+
.join("");
140+
141+
content.className = "";
142+
content.innerHTML = `
143+
<table>
144+
<thead>
145+
<tr>
146+
<th>Paper</th>
147+
<th>Repository</th>
148+
<th>Submodule path</th>
149+
<th>Notes</th>
150+
</tr>
151+
</thead>
152+
<tbody>${rows}</tbody>
153+
</table>
154+
`;
155+
}
156+
157+
fetch("./papers.json")
158+
.then((response) => {
159+
if (!response.ok) {
160+
throw new Error("Unable to load paper metadata.");
161+
}
162+
163+
return response.json();
164+
})
165+
.then((data) => {
166+
const papers = Array.isArray(data.papers) ? data.papers : [];
167+
168+
if (!papers.length) {
169+
renderEmptyState(
170+
"No linked journal papers have been added yet. Add a repository submodule under repositories/ and a matching entry in papers.json.",
171+
);
172+
return;
173+
}
174+
175+
renderTable(papers);
176+
})
177+
.catch((error) => {
178+
renderEmptyState(error.message);
179+
});
180+
</script>
181+
</body>
182+
</html>

papers.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"papers": []
3+
}

repositories/.gitkeep

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)