Skip to content

Commit f51b522

Browse files
authored
Merge pull request #1 from ERMETE-Lab/copilot/add-journal-paper-wrapper
Add a static papers index for linked ERMETE-Lab repositories
2 parents 73c6016 + 913fae1 commit f51b522

5 files changed

Lines changed: 279 additions & 1 deletion

File tree

.github/workflows/deploy-pages.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Deploy index to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: false
17+
18+
jobs:
19+
deploy:
20+
environment:
21+
name: github-pages
22+
url: ${{ steps.deployment.outputs.page_url }}
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Pages
29+
uses: actions/configure-pages@v5
30+
31+
- name: Upload static site artifact
32+
uses: actions/upload-pages-artifact@v3
33+
with:
34+
path: .
35+
36+
- name: Deploy to GitHub Pages
37+
id: deployment
38+
uses: actions/deploy-pages@v4

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,30 @@
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 `authors`, `journal`, `year`, `doi`, `paper_url`, and `notes`
23+
24+
Until entries are added, the wrapper renders an empty-state message instead of
25+
an empty table.
26+
27+
## GitHub Pages
28+
29+
The repository includes a workflow that publishes the static site (`index.html`
30+
and `papers.json`) to GitHub Pages on pushes to `main`.

index.html

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
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.authors ? `<div>${paper.authors}</div>` : ""}
129+
${paper.journal ? `<div>${paper.journal}</div>` : ""}
130+
${paper.year ? `<div>${paper.year}</div>` : ""}
131+
</td>
132+
<td>
133+
${
134+
paper.paper_url
135+
? `<a href="${paper.paper_url}">Read paper</a>`
136+
: ""
137+
}
138+
${paper.doi ? `<div><code>${paper.doi}</code></div>` : ""}
139+
</td>
140+
<td>
141+
<a href="${paper.repository_url}">${paper.repository}</a>
142+
</td>
143+
<td><code>${paper.submodule_path}</code></td>
144+
<td>${paper.notes ?? ""}</td>
145+
</tr>
146+
`,
147+
)
148+
.join("");
149+
150+
content.className = "";
151+
content.innerHTML = `
152+
<table>
153+
<thead>
154+
<tr>
155+
<th>Paper</th>
156+
<th>Publication</th>
157+
<th>Repository</th>
158+
<th>Submodule path</th>
159+
<th>Notes</th>
160+
</tr>
161+
</thead>
162+
<tbody>${rows}</tbody>
163+
</table>
164+
`;
165+
}
166+
167+
fetch("./papers.json")
168+
.then((response) => {
169+
if (!response.ok) {
170+
throw new Error("Unable to load paper metadata.");
171+
}
172+
173+
return response.json();
174+
})
175+
.then((data) => {
176+
const papers = Array.isArray(data.papers) ? data.papers : [];
177+
178+
if (!papers.length) {
179+
renderEmptyState(
180+
"No linked journal papers have been added yet. Add a repository submodule under repositories/ and a matching entry in papers.json.",
181+
);
182+
return;
183+
}
184+
185+
renderTable(papers);
186+
})
187+
.catch((error) => {
188+
renderEmptyState(error.message);
189+
});
190+
</script>
191+
</body>
192+
</html>

papers.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"papers": [
3+
{
4+
"title": "Robust state estimation from partial out-core measurements with Shallow Recurrent Decoder for nuclear reactors",
5+
"authors": "Stefano Riva; Carolina Introini; Antonio Cammi; J. Nathan Kutz",
6+
"journal": "Progress in Nuclear Energy",
7+
"year": 2025,
8+
"volume": "189",
9+
"pages": "105928",
10+
"repository": "NuSHRED",
11+
"repository_url": "https://github.com/ERMETE-Lab/NuSHRED",
12+
"submodule_path": "repositories/NuSHRED",
13+
"doi": "10.1016/j.pnucene.2025.105928",
14+
"paper_url": "https://www.sciencedirect.com/science/article/pii/S0149197025003269",
15+
"notes": "State reconstruction from three out-of-core neutron flux measurements over 20 coupled field variables."
16+
}
17+
]
18+
}

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)