Skip to content

Commit d917705

Browse files
lilyhealeynhrqz
andauthored
feat: add handling for TOC and root files (#1)
* feat: add handling for TOC and root files * fix: increment version number --------- Co-authored-by: Nick Henriquez <[email protected]>
1 parent 88cb2de commit d917705

File tree

2 files changed

+36
-5
lines changed

2 files changed

+36
-5
lines changed

article.raw.schema.xsd

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,21 @@
2222
</xs:restriction>
2323
</xs:simpleType>
2424

25+
<xs:simpleType name="article_archive_id_type">
26+
<xs:restriction base="xs:string">
27+
<xs:pattern value="\d{4}_\d{2}_\d{2}-(CV\d|\d{3})-(CV\d|\d{3})-[a-z_]+(-(\d{2}|root))?"/>
28+
</xs:restriction>
29+
</xs:simpleType>
30+
2531
<xs:simpleType name="img_archive_id_type">
2632
<xs:restriction base="xs:string">
27-
<xs:pattern value="\d{4}_\d{2}_\d{2}-\d{3}(-\d{3}-ad(-\d{2})?)?-image(-\d{2})?"/>
33+
<xs:pattern value="\d{4}_\d{2}_\d{2}-(CV\d|\d{3})(-(CV\d|\d{3})-ad(-\d{2})?)?-image(-\d{2})?"/>
2834
</xs:restriction>
2935
</xs:simpleType>
3036

3137
<xs:simpleType name="img_archive_src_type">
3238
<xs:restriction base="xs:string">
33-
<xs:pattern value="\d{4}_\d{2}_\d{2}-\d{3}(-\d{3}-ad(-\d{2})?)?-image(-\d{2})?.jpg"/>
39+
<xs:pattern value="\d{4}_\d{2}_\d{2}-(CV\d|\d{3})(-(CV\d|\d{3})-ad(-\d{2})?)?-image(-\d{2})?.jpg"/>
3440
</xs:restriction>
3541
</xs:simpleType>
3642

@@ -154,6 +160,7 @@
154160
<xs:enumeration value="byline"/>
155161
<xs:enumeration value="note"/>
156162
<xs:enumeration value="descender"/>
163+
<xs:enumeration value="chapter-heading"/>
157164
</xs:restriction>
158165
</xs:simpleType>
159166

@@ -185,6 +192,7 @@
185192
<xs:element name="figure" type="figure_type"/>
186193
<xs:element name="article" type="article_type"/>
187194
</xs:choice>
195+
<xs:attribute name="id" type="article_archive_id_type"/>
188196
</xs:complexType>
189197

190198
<!-- END TYPE DEFINITIONS -->

article.schema.json

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
3-
"$id": "https://raw.githubusercontent.com/CondeNast/tny-archive-schemas/v1.0.0/article.schema.json",
3+
"$id": "https://raw.githubusercontent.com/CondeNast/tny-archive-schemas/v1.1.0/article.schema.json",
44
"title": "Article",
55
"description": "A New Yorker article. This schema also validates ads which appeared in The New Yorker.",
66
"type": "object",
@@ -75,7 +75,7 @@
7575
"pattern": "^(19|20)\\d\\d_[01]\\d_[0123]\\d-(CV\\d|\\d{3})-(CV\\d|\\d{3})-ad(-\\d{2})?-image(-\\d{2})?(\\.jpg)?$"
7676
},
7777
{
78-
"pattern": "^(19|20)\\d\\d_[01]\\d_[0123]\\d-(CV\\d|\\d{3})-(CV\\d|\\d{3})-[a-z_]+(-\\d{2})?$"
78+
"pattern": "^(19|20)\\d\\d_[01]\\d_[0123]\\d-(CV\\d|\\d{3})-(CV\\d|\\d{3})-[a-z_]+(-\\d{2}|-root)?$"
7979
}
8080
],
8181
"examples": [
@@ -282,6 +282,16 @@
282282
"@type": {
283283
"const": "PublicationIssue"
284284
},
285+
"name": {
286+
"type": "string",
287+
"description": "The name of the issue, as printed on the cover, near the page numbers or on the table of contents.",
288+
"examples": [
289+
"June 7, 1969",
290+
"June 27 & July 4, 1994",
291+
"December 25, 2000 & January 1, 2001",
292+
"August 19 & 26, 2002"
293+
]
294+
},
285295
"issueNumber": {
286296
"type": "integer",
287297
"minimum": 1
@@ -431,7 +441,20 @@
431441
},
432442
{
433443
"type": "object",
434-
"description": "Supplemental text at the end of the article, perhaps following a signer. This may be an italicized note, such as a translation credit or additional context like “This is the first part of a two-part Profile.” In the “Goings on About Town” section, this would correspond to italicized details about schedules and locations following an event’s description.",
444+
"description": "A referenced article (for root articles only).",
445+
"additionalProperties": false,
446+
"properties": {
447+
"@type": {
448+
"const": ["Article"]
449+
},
450+
"sameAs": {
451+
"$ref": "#/$defs/archiveId"
452+
}
453+
}
454+
},
455+
{
456+
"type": "object",
457+
"description": "Supplemental text, often at the start or end of the article, perhaps following a signer. This may be an italicized note, such as a translation credit or additional context like “This is the first part of a two-part Profile.” In the “Goings on About Town” section, this would correspond to italicized details about schedules and locations following an event’s description.",
435458
"required": [
436459
"@type",
437460
"additionalType",

0 commit comments

Comments
 (0)