Skip to content

Commit

Permalink
feat(schema): Only include author schema from pubmatter spec
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesrswift committed May 24, 2024
1 parent b54022b commit 7b32621
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 219 deletions.
2 changes: 1 addition & 1 deletion src/schemas.typ
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#import "schemas/pubmatter.typ": author, affiliation, pubmatter, abstracts
#import "schemas/author.typ": author
#import "schemas/enumerations.typ": papersize
40 changes: 40 additions & 0 deletions src/schemas/author.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#import "../types.typ" as z;
#import "../coercions.typ" as coerce;

#let author = z.dictionary(
aliases: (
"affiliation": "affiliations",
"website": "url",
"homepage": "url",
"ORCID": "orcid",
"equal_contributor": "equal-contributor",
"equalContributor": "equal-contributor",
),
(
name: z.string(),
url: z.string(optional: true),
phone: z.string(optional: true),
fax: z.string(optional: true),
orcid: z.string(optional: true),
note: z.string(optional: true),
email: z.email(optional: true),
corresponding: z.boolean(optional: true),
equal-contributor: z.boolean(optional: true),
deceased: z.boolean(optional: true),
roles: z.array(z.string(), pre-transform: coerce.array),
affiliations: z.array(
z.either(
z.string(),
z.number(),
),
pre-transform: coerce.array,
),
),
pre-transform: coerce.dictionary(it => (name: it)),
post-transform: (self, it) => {
if (it.at("email", default: none) != none and it.corresponding == none) {
it.insert("corresponding", true)
}
return it
},
)
142 changes: 0 additions & 142 deletions src/schemas/pubmatter.typ

This file was deleted.

Binary file removed tests/integration/joined-dictionaries/ref/1.png
Binary file not shown.
27 changes: 0 additions & 27 deletions tests/integration/joined-dictionaries/test.typ

This file was deleted.

Binary file not shown.
15 changes: 0 additions & 15 deletions tests/integration/pubmatter/abstracts-schema/test.typ

This file was deleted.

Binary file not shown.
12 changes: 0 additions & 12 deletions tests/integration/pubmatter/affiliations-schema/test.typ

This file was deleted.

Binary file removed tests/integration/pubmatter/ref/1.png
Binary file not shown.
22 changes: 0 additions & 22 deletions tests/integration/pubmatter/test.typ

This file was deleted.

File renamed without changes
File renamed without changes.

0 comments on commit 7b32621

Please sign in to comment.