# CRediT Roles
This document contains tests and examples for enabling
export of roles to JATS. It was added for
[Issue #10152](https://github.com/jgm/pandoc/issues/10152)
and corresponding [Pull Request #10153](https://github.com/jgm/pandoc/pull/10153).
In the first example, we show a fully qualified CRediT role.
An explicit name isn't given, so the CRediT name is used.
```
% pandoc -s -t jats
---
title: CRediT Test
author:
- name: Max Mustermann
affiliation: [ 1 ]
roles:
- credit: software
credit-name: Software
degree: Lead
affiliation:
- id: 1
name: Silverlight University
---
^D
CRediT Test
Max Mustermann
Software
Silverlight University
```
In the second example, we show a fully qualified CRediT role.
An explicit name is given in a different language.
```
% pandoc -s -t jats
---
title: CRediT Test
author:
- name: Max Mustermann
affiliation: [ 1 ]
roles:
- credit: software
credit-name: Software
degree: Lead
name: Programas
affiliation:
- id: 1
name: Silverlight University
---
^D
CRediT Test
Max Mustermann
Programas
Silverlight University
```
In this example, we show a partially qualified CRediT role
that does not have a `degree`:
```
% pandoc -s -t jats
---
title: CRediT Test
author:
- name: Max Mustermann
affiliation: [ 1 ]
roles:
- credit: software
credit-name: Software
affiliation:
- id: 1
name: Silverlight University
---
^D
CRediT Test
Max Mustermann
Software
Silverlight University
```
In this example, we show a more stripped-down data that requires automatic lookup of the
`credit-name`.
```
% pandoc -s -t jats
---
title: CRediT Test
author:
- name: Max Mustermann
affiliation: [ 1 ]
roles:
- credit: software
affiliation:
- id: 1
name: Silverlight University
---
^D
CRediT Test
Max Mustermann
Software
Silverlight University
```
In this example, we test the correct XML encoding of
the CRediT role [Writing – review & editing](https://credit.niso.org/contributor-roles/writing-review-editing/),
which annoyingly contains an ampersand in its label.
```
% pandoc -s -t jats
---
title: CRediT Test
author:
- name: Max Mustermann
affiliation: [ 1 ]
roles:
- credit: writing-review-editing
credit-name: Writing – review & editing
degree: Lead
affiliation:
- id: 1
name: Silverlight University
---
^D
CRediT Test
Max Mustermann
Writing – review & editing
Silverlight University
```
In this example, we show a role that isn't qualified with CRediT.
```
% pandoc -s -t jats
---
title: CRediT Test
author:
- name: Max Mustermann
affiliation: [ 1 ]
roles:
- name: Dolphin Catcher
affiliation:
- id: 1
name: Silverlight University
---
^D
CRediT Test
Max Mustermann
Dolphin Catcher
Silverlight University
```
In this example, we show a role that neither has a CRediT identifer,
nor a name, so it's ignored.
```
% pandoc -s -t jats
---
title: CRediT Test
author:
- name: Max Mustermann
affiliation: [ 1 ]
roles:
- irrelevant-key: Dolphin Catcher
affiliation:
- id: 1
name: Silverlight University
---
^D
CRediT Test
Max Mustermann
Silverlight University
```