Open jameshadfield opened 4 years ago
@jameshadfield I'd be happy to take a look at this. I'm pretty busy Monday, but should be able to take a look at this on Tuesday.
@jameshadfield
What do you think of the format JOSS uses for it's authors and affiliations?
Below is an excerpt from the frontmatter of their example paper, documented here:
authors:
- name: Adrian M. Price-Whelan
orcid: 0000-0003-0872-7098
affiliation: "1, 2" # (Multiple affiliations must be quoted)
- name: Author Without ORCID
affiliation: 2
affiliations:
- name: Lyman Spitzer, Jr. Fellow, Princeton University
index: 1
- name: Institution 2
index: 2
There's also the pandoc-scholar format as prior art.
Below is an example of the pandoc-scholar format,
author:
- Jane Doe:
institute:
- fosg
- fop
email: jane.doe@example.com
orcid: 0000-0000-0000-0000
equal_contributor: "yes"
correspondence: "yes"
- John Q. Doe:
institute: fosg
equal_contributor: "yes"
- Peder Ås:
institute: fosg
- Juan Pérez:
institute: acme
email: juan.perez@example.edu
correspondence: "yes"
institute:
- fosg:
name: Formatting Open Science Group
address: 23 Science Street, Eureka, Mississippi, USA
phone: +1 (555) 423 1338
email: '{firstname}.{lastname}\@fosg.example.com'
- fop: Federation of Planets
- acme:
name: Acme Corporation
I think the JOSS format would be a little bit easier to parse, however neither one would be too difficult. With the number of authors on the narratives keeping track of the affiliations by index could prove difficult and error prone.
Also, does this need to be backwards compatible?
Also, does this need to be backwards compatible?
Yes, any changes / additions to the narratives must be backwards compatible.
@jameshadfield Do you have an opinion on what format to use for specifying names and affiliations?
I tried to start working on this today, but I couldn't find where the YAML frontmatter is converted into HTML. Does anyone know where this happens?
Background
Currently the YAML frontmatter at the start of each narrative markdown file is parsed by this code into HTML to be rendered by the client as the fist page of the narrative. E.g. this YAML tuns into this narrative page.
Currently we display YAML fields
title
,authors
,authorLinks
,affiliations
,translators
,translatorLinks
,date
andupdated
.PR #937 created a function which allowed
authors
+authorLinks
(ortranslators
+translatorLinks
) to be arrays. Howeveraffiliations
must be a string and represents all authors.Changes requested
We should extend the functions created in #937 to allow parsing of multiple affiliations. I think the cleanest way to do this is to require that if the type is an array then it must be the same length as
authors
. Duplicate affiliations (which will be the norm) should be specified separately by the frontmatter and grouped together by the parsing code. Unique affiliations should receive superscript arabic numerals (as we currently do, but it's always1
!), in a first-come-first-served fashion. Empty elements in the array should be allowed for authors without an affiliation.The key names should change to
authorAffiliations
andtranslatorAffiliations
. For simplicity, they should be treated as independent objects for rendering purposes. For backwards compatibility, ifaffiliations
is set it should be interpreted asauthorAffiliations
.Note: It's possible for authors to have multiple affiliations. This would naturally be supported by nested arrays in YAML. This functionality isn't required for this issue, but could be part of it if you want!
@ncallaway would you be interested in this? (no problem if not)