From 637f87c76bd0be241f5bfa9acbf7fc32ba53d13f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesper=20Engstr=C3=B6m?= Date: Fri, 9 Oct 2026 15:05:13 +0200 Subject: [PATCH] feat(lxlweb): add Vancouver citation style --- .../csl/elsevier-vancouver-author-date.csl | 184 ++++++++++++++++++ lxl-web/src/lib/utils/citation.ts | 15 +- 2 files changed, 198 insertions(+), 1 deletion(-) create mode 100644 lxl-web/src/lib/assets/csl/elsevier-vancouver-author-date.csl diff --git a/lxl-web/src/lib/assets/csl/elsevier-vancouver-author-date.csl b/lxl-web/src/lib/assets/csl/elsevier-vancouver-author-date.csl new file mode 100644 index 0000000000..204801f5df --- /dev/null +++ b/lxl-web/src/lib/assets/csl/elsevier-vancouver-author-date.csl @@ -0,0 +1,184 @@ + + diff --git a/lxl-web/src/lib/utils/citation.ts b/lxl-web/src/lib/utils/citation.ts index 80e71c9dd6..052331a0c0 100644 --- a/lxl-web/src/lib/utils/citation.ts +++ b/lxl-web/src/lib/utils/citation.ts @@ -25,6 +25,10 @@ export const availableFormats = { name: 'Harvard', fullName: 'Harvard (Södertörns högskola — author-date/Harvard)' }, + elsevier_vancouver: { + name: 'Vancouver', + fullName: 'Elsevier - NLM/Vancouver (name-year)' + }, ris: { name: 'RIS', fileFormat: 'ris' @@ -73,6 +77,12 @@ export async function initCite(locale: LocaleCode) { return cite.format('bibliography', { template: 'oxford_umu', format: 'html', lang }); case 'harvard_sh': return cite.format('bibliography', { template: 'harvard_sh', format: 'html', lang }); + case 'elsevier_vancouver': + return cite.format('bibliography', { + template: 'elsevier_vancouver', + format: 'html', + lang + }); default: console.warn('asked for unavailable format', name); return '-'; @@ -97,7 +107,10 @@ async function loadCiteResources() { // https://editor.citationstyles.org/styleInfo/?styleId=http%3A%2F%2Fwww.zotero.org%2Fstyles%2Fumea-university-oxford oxford_umu: (await import('$lib/assets/csl/umea-university-oxford.csl?raw')).default, // https://editor.citationstyles.org/styleInfo/?styleId=http%3A%2F%2Fwww.zotero.org%2Fstyles%2Fsodertorns-hogskola-harvard - harvard_sh: (await import('$lib/assets/csl/sodertorns-hogskola-harvard.csl?raw')).default + harvard_sh: (await import('$lib/assets/csl/sodertorns-hogskola-harvard.csl?raw')).default, + // https://editor.citationstyles.org/styleInfo/?styleId=http%3A%2F%2Fwww.zotero.org%2Fstyles%2Felsevier-vancouver-author-date + elsevier_vancouver: (await import('$lib/assets/csl/elsevier-vancouver-author-date.csl?raw')) + .default }; // https://github.com/citation-js/citation-js/tree/main/packages/plugin-csl