Skip to content

Commit 888893f

Browse files
committed
always append url to ACM citations
1 parent 4df0401 commit 888893f

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

vis/js/utils/useCitationStyle.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ export const availableStyles = [
3838
name: "ACM",
3939
template: "custom-acm",
4040
description: 'ACM SIG Proceedings ("et al." for 3+ authors)',
41+
append: (paper) => {
42+
// feature request from Peter, not an official part of ACM
43+
if (!paper.list_link.isDoi) {
44+
return " " + paper.list_link.address;
45+
}
46+
47+
return "";
48+
},
4149
},
4250
];
4351

@@ -62,9 +70,15 @@ const useCitationStyle = () => {
6270
type: getType(paper),
6371
});
6472

65-
return cite.format("bibliography", {
73+
let output = cite.format("bibliography", {
6674
template: style.template,
6775
});
76+
77+
if (style.append) {
78+
output += style.append(paper);
79+
}
80+
81+
return output;
6882
};
6983

7084
return [style, setStyle, getCitation];

vis/test/component/modals.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ describe("Modals component", () => {
374374
// tbh I don't get it why the output is this and not ACM
375375
expect(
376376
document.querySelector("#copy-paper-citation").textContent.trim()
377-
).toBe("Doe, J. (2021). Test paper. https://example.com");
377+
).toBe("Doe, J. (2021). Test paper. https://example.com\n https://example.com");
378378
});
379379
});
380380

0 commit comments

Comments
 (0)