-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreadme-sections.schema.json
More file actions
146 lines (146 loc) · 6.61 KB
/
Copy pathreadme-sections.schema.json
File metadata and controls
146 lines (146 loc) · 6.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/ptr727/ProjectTemplate/spec/readme-sections.schema.json",
"title": "README section and shield model",
"type": "object",
"required": ["sections", "shieldClasses", "linkGroups", "linkNaming", "canonicalLinks", "distribution"],
"additionalProperties": false,
"properties": {
"$schema": { "type": "string" },
"note": { "type": "string" },
"sections": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["name", "ordinal", "required"],
"additionalProperties": false,
"properties": {
"name": { "type": "string", "minLength": 1 },
"ordinal": { "type": "integer", "minimum": 1 },
"required": { "enum": ["always", "public", "optional"] },
"last": { "type": "boolean" },
"subsections": { "type": "array", "items": { "type": "string", "minLength": 1 } },
"retiredNames": { "type": "array", "items": { "type": "string", "minLength": 1 } },
"notApplicableTo": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 } }
}
}
},
"directiveComments": {
"type": "array",
"items": { "type": "string", "minLength": 1, "description": "A comment prefix that instructs a tool rather than naming a link group." }
},
"linkGroups": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["name", "holds"],
"additionalProperties": false,
"properties": {
"name": { "type": "string", "minLength": 1 },
"holds": { "$ref": "#/$defs/linkKind" },
"note": { "type": "string" }
}
}
},
"linkNaming": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["kind", "suffix"],
"additionalProperties": false,
"properties": {
"kind": { "$ref": "#/$defs/linkKind" },
"suffix": { "type": "string", "description": "The suffix a reference name carries for this kind. An empty string means a bare name." },
"note": { "type": "string" }
}
}
},
"distribution": {
"type": "object",
"required": ["urlPrefixes"],
"additionalProperties": false,
"properties": {
"note": { "type": "string" },
"urlPrefixes": {
"type": "array",
"minItems": 1,
"items": { "type": "string", "minLength": 1, "description": "A URL prefix making a link the project's own. `{slug}` is owner/repo, `{owner}` is the owner." }
}
}
},
"canonicalLinks": {
"type": "array",
"items": {
"type": "object",
"required": ["name"],
"anyOf": [{ "required": ["repoPath"] }, { "required": ["match"] }],
"additionalProperties": false,
"properties": {
"name": { "type": "string", "minLength": 1 },
"repoPath": { "type": "string", "description": "Matched against the repository's own URL plus this path. An empty string is the repository root." },
"match": { "type": "string", "minLength": 1, "description": "A regular expression, for a destination that is not under the repository URL." },
"prefix": { "type": "boolean", "description": "Match repoPath as a prefix rather than exactly, for a path carrying a branch or a sub-path." },
"perTarget": { "type": "boolean", "description": "The repository may publish more than one of these. One takes the bare name; several each take `<target>-<name>`." }
}
}
},
"deprecatedShields": {
"type": "array",
"items": {
"type": "object",
"required": ["match", "label", "reason"],
"additionalProperties": false,
"properties": {
"match": { "type": "string", "minLength": 1, "description": "A substring of the badge URL." },
"label": { "type": "string", "minLength": 1 },
"reason": { "type": "string", "minLength": 1 }
}
}
},
"shieldClasses": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["name", "trigger", "shields"],
"additionalProperties": false,
"properties": {
"name": { "type": "string", "minLength": 1 },
"trigger": {
"type": "object",
"required": ["kind"],
"additionalProperties": false,
"properties": {
"kind": { "enum": ["always", "publish", "secret"] },
"target": { "type": "string", "minLength": 1 },
"name": { "type": "string", "minLength": 1 }
}
},
"shields": { "$ref": "#/$defs/shieldList" }
}
}
}
},
"$defs": {
"linkKind": { "enum": ["shield", "distribution", "external", "anchor", "local"] },
"shieldList": {
"type": "array",
"items": {
"type": "object",
"required": ["label", "match", "in"],
"additionalProperties": false,
"properties": {
"label": { "type": "string", "minLength": 1 },
"match": { "type": "string", "minLength": 1 },
"in": { "type": "string", "minLength": 1, "description": "The section the shield belongs in, as `Heading` or `Heading > Sub-heading`." },
"exclusive": { "type": "boolean", "description": "The shield must appear nowhere outside the section it names." },
"requireQuery": { "type": "string", "minLength": 1 },
"forbidQuery": { "type": "string", "minLength": 1 }
}
}
}
}
}