Contributor Roles Taxonomy
I'm preparing a document in which I'd like to add the CRediT. I'm adding the roles as a small table, based on the display here: https://github.com/Pseudomanifold/latex-credits
It would be nicecool, if the CRediT roles could be put into the author metadata file somehow.
I like that tabular display. Perhaps that could be logged as a future Manubot feature idea?
For now, it is possible to use the metadata file to track CRediT roles and list them in a regular table after the manuscript. We did that in https://github.com/greenelab/covid19-review
See the contributions: in metadata.yaml and 70.coi-contribs.md that writes the table. The contributions are free text and not constrained to recognized CRediT roles.
and list them in a regular table after the manuscript
For now I manually generated a table in Markdown, but having the contributions tracked in the metadata file and automatically generating them from there is so much nicer.
Just noting what we did for author roles at https://github.com/greenelab/xswap-manuscript/commit/ad40823592a4f0c9b264d6e94db0cacc005c2707 and https://github.com/greenelab/xswap-manuscript/commit/2a8cc8f718fd406fe170212139e5c495a565f12a. Here's the markdown / jinja2 template for generating a contribution summary based on metadata roles:
Author contributions are noted here according to [CRediT](https://credit.niso.org/) (Contributor Roles Taxonomy).
{%- set roles = {} -%}
{%- for author in manubot.authors -%}
{% for role in author.get('roles', []) -%}
{%- if role in roles -%}
{% set _ = roles[role].append(author.initials) %}
{%- else -%}
{% set _ = roles.update({role: [author.initials]}) %}
{%- endif -%}
{%- endfor -%}
{%- endfor %}
{% for role, author_initials in roles.items() -%}
{% if author_initials|length > 2 %}
{{- role }} by {{ ', '.join(author_initials[:-1]) }}, and {{ author_initials[-1] }}.
{% elif author_initials|length == 2 %}
{{- role }} by {{ ' and '.join(author_initials) }}.
{% else %}
{{- role }} by {{ author_initials[0] }}.
{%- endif -%}
{%- endfor %}
Which rendered as:
Author contributions are noted here according to CRediT (Contributor Roles Taxonomy). Conceptualization by MZ, DSH, KAK, and CSG. Data curation by MZ and DSH. Formal analysis by MZ and DSH. Investigation by MZ, DSH, MWN, and CSG. Methodology by MZ, DSH, KAK, CW, and CSG. Project administration by MZ, DSH, and CSG. Software by MZ, DSH, and CW. Visualization by MZ and DSH. Writing – original draft by MZ.Writing – review & editing by MZ, DSH, and CSG. Resources by DSH, MWN, and CSG. Supervision by DSH and CSG. Funding acquisition by CSG.