Skip to content

Commit

Permalink
add corresponding author
Browse files Browse the repository at this point in the history
  • Loading branch information
tavareshugo committed Aug 27, 2024
1 parent 975fe0d commit ba169c0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion _extensions/courseformat/_extension.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
title: Course Page Format
author: Cambridge Informatics Training
version: 1.1.0
version: 1.1.1
contributes:
formats:
html:
Expand Down
13 changes: 8 additions & 5 deletions _extensions/courseformat/citation_cff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 '<a href="' .. author.orcid .. '" target="_blank"><i class="fa-brands fa-orcid" style="color:#a6ce39"></i></a>' or ""
local email_icon = author.website and '<a href="' .. author.website .. '" target="_blank"><i class="fa-solid fa-envelope" style="color:#003E74"></i></a>' or ""
local affiliation = author.affiliation and '<em>Affiliation</em>: ' .. author.affiliation .. '<br>' or ""
local roles = author.alias and '<em>Roles</em>: ' .. author.alias or ""

author_info = author_info .. string.format([[
<li><strong>%s</strong> %s<br>
<li><strong>%s</strong> %s %s<br>
%s %s
</li>
]], name, orcid_icon, affiliation, roles)
]], name, orcid_icon, email_icon, affiliation, roles)
end
author_info = author_info .. "</ul>"

Expand Down
4 changes: 3 additions & 1 deletion materials/03-authorship.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**.

0 comments on commit ba169c0

Please sign in to comment.