From ba169c0d25395a9a5b344a2eecdf9f075c3fea74 Mon Sep 17 00:00:00 2001 From: Hugo Tavares Date: Tue, 27 Aug 2024 12:05:30 +0100 Subject: [PATCH] add corresponding author --- CITATION.cff | 1 + _extensions/courseformat/_extension.yml | 2 +- _extensions/courseformat/citation_cff.lua | 13 ++++++++----- materials/03-authorship.md | 4 +++- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index 8ef6baa..ae20c55 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -16,6 +16,7 @@ authors: - given-names: Hugo family-names: Tavares affiliation: Cambridge Centre for Research Informatics Training + website: 'https://bioinfotraining.bio.cam.ac.uk/staff/hugo-tavares-phd' orcid: 'https://orcid.org/0000-0001-9373-2726' alias: 'writing - original draft; conceptualisation; software' - given-names: Martin diff --git a/_extensions/courseformat/_extension.yml b/_extensions/courseformat/_extension.yml index d9a4913..34a493d 100644 --- a/_extensions/courseformat/_extension.yml +++ b/_extensions/courseformat/_extension.yml @@ -1,6 +1,6 @@ title: Course Page Format author: Cambridge Informatics Training -version: 1.1.0 +version: 1.1.1 contributes: formats: html: diff --git a/_extensions/courseformat/citation_cff.lua b/_extensions/courseformat/citation_cff.lua index a9e0a56..581fdbb 100644 --- a/_extensions/courseformat/citation_cff.lua +++ b/_extensions/courseformat/citation_cff.lua @@ -60,11 +60,13 @@ function parse_cff(file_path) -- Populate author fields if line:match("given%-names:") then - current_author["given-names"] = trim(line:gsub("%-?%s*given%-names:", "")) + current_author["given-names"] = trim(line:gsub("%-?%s*given%-names:", ""):gsub("'", "")) elseif line:match("family%-names:") then - current_author["family-names"] = trim(line:gsub("%-?%s*family%-names:", "")) + current_author["family-names"] = trim(line:gsub("%-?%s*family%-names:", ""):gsub("'", "")) elseif line:match("affiliation:") then - current_author["affiliation"] = trim(line:gsub("%-?%s*affiliation:", "")) + current_author["affiliation"] = trim(line:gsub("%-?%s*affiliation:", ""):gsub("'", "")) + elseif line:match("website:") then + current_author["website"] = trim(line:gsub("%-?%s*website:", ""):gsub("'", "")) elseif line:match("orcid:") then current_author["orcid"] = trim(line:gsub("%-?%s*orcid:", ""):gsub("'", "")) elseif line:match("alias:") then @@ -127,14 +129,15 @@ return { for _, author in ipairs(authors) do local name = author["given-names"] .. " " .. author["family-names"] local orcid_icon = author.orcid and '' or "" + local email_icon = author.website and '' or "" local affiliation = author.affiliation and 'Affiliation: ' .. author.affiliation .. '
' or "" local roles = author.alias and 'Roles: ' .. author.alias or "" author_info = author_info .. string.format([[ -
  • %s %s
    +
  • %s %s %s
    %s %s
  • -]], name, orcid_icon, affiliation, roles) +]], name, orcid_icon, email_icon, affiliation, roles) end author_info = author_info .. "" diff --git a/materials/03-authorship.md b/materials/03-authorship.md index 3805eae..a2e9ea9 100644 --- a/materials/03-authorship.md +++ b/materials/03-authorship.md @@ -25,4 +25,6 @@ Each repository has a `CITATION.cff` file, which is used to automatically popula Unfortunately, at the present the CFF format schema does not allow adding an author "role" ([see here](https://github.com/citation-file-format/citation-file-format/issues/112)). As a workaround, we use the author `alias` entry to record this information. -We don't have a formal ontology for author roles, although we take inspiration from [CRT](https://credit.niso.org/contributor-roles-defined/) and [DataCite](https://datacite-metadata-schema.readthedocs.io/en/4.5/appendices/appendix-1/contributorType/). +We don't have a formal **ontology for author roles**, although we take inspiration from [CRT](https://credit.niso.org/contributor-roles-defined/) and [DataCite](https://datacite-metadata-schema.readthedocs.io/en/4.5/appendices/appendix-1/contributorType/). + +We use the author `website` entry to indicate **corresponding authors**. \ No newline at end of file