|
| 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> |
0 commit comments