diff options
author | Tom Smeding <tom@tomsmeding.com> | 2022-08-23 16:18:32 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2022-08-23 16:18:32 +0200 |
commit | 7f751b7af74c6be98e332445f9b5a949722a9a3e (patch) | |
tree | 5cc06a6f0e3a9c69737165ed216e556a957aad9b /webserver.js | |
parent | b29bbc36748e138d7ac7ad115902dad112913f87 (diff) |
Update CHAD publication (TOPLAS)
Diffstat (limited to 'webserver.js')
-rwxr-xr-x | webserver.js | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/webserver.js b/webserver.js index 6b3a172..f817016 100755 --- a/webserver.js +++ b/webserver.js @@ -104,18 +104,36 @@ function buildPublicationsHTML(info) { for (const obj of info.pubs) { if (res.length != 0) res += "\n\t\t\t"; + const seen = new Map(); + res += "<li>"; + res += obj.year; + seen.set("year", true); + if ("month" in obj) res += "-" + padLeft(obj.month + "", 2, "0") + seen.set("month", true); + res += " "; res += obj.authors.map(key => key in info.authors ? info.authors[key] : key).join(", "); + seen.set("authors", true); + res += ": “" + obj.title + "”."; + seen.set("title", true); + + if ("journal" in obj) res += " In " + obj.journal + "."; + seen.set("journal", true); + if ("preprint" in obj) { res += " Preprint"; if (typeof obj.preprint == "string") res += ", " + obj.preprint; res += "."; } + seen.set("preprint", true); + if ("note" in obj) res += " " + obj.note; + seen.set("note", true); + if ("links" in obj && obj.links.length > 0) { res += " ["; const anchors = []; @@ -125,7 +143,12 @@ function buildPublicationsHTML(info) { case "arxiv": name = "arxiv"; url = "https://arxiv.org/abs/" + link.id; - break + break; + + case "doi": + name = "doi"; + url = "https://doi.org/" + link.id; + break; case "code": name = "code"; @@ -145,7 +168,15 @@ function buildPublicationsHTML(info) { res += anchors.join(", "); res += "]" } + seen.set("links", true); + res += "</li>"; + + for (const key in obj) { + if (!seen.has(key)) { + throw new Error(`Key '${key}' unknown in publication`); + } + } } return res; |