@@ -52,25 +52,25 @@ Additional directories with special meaning:
52
52
- ` {requirement-or-assertion-name}.md ` - Defines content of an individual requirement or assertion
53
53
- ` terms/ ` - Contents of terms defined in the Glossary
54
54
55
- ### Notable subdirectories under ` src `
55
+ ### Notable Subdirectories under ` src `
56
56
57
57
- ` src/lib/ ` - contains files that contribute to Astro build or template logic
58
58
- ` markdown/ ` - contains files implementing remark and rehype plugins, to transform output of
59
59
Markdown files
60
60
61
61
## Editing the Guidelines
62
62
63
- ### Supported fields
63
+ ### Supported Fields
64
64
65
- This section explains the fields available to frontmatter defined at the top of markdown files
65
+ This section explains the fields available to frontmatter defined at the top of Markdown files
66
66
for guidelines, requirements/assertions, and terms, and within JSON files for groups.
67
67
68
68
For those unfamiliar with the term, frontmatter refers to YAML written at the top of a file,
69
69
surrounded on each side by a line consisting of 3 hyphens.
70
70
71
71
See existing files under the ` guidelines ` folder for examples.
72
72
73
- #### Common fields
73
+ #### Common Fields
74
74
75
75
These are available to multiple data types, as specified in each respective section below.
76
76
@@ -92,7 +92,7 @@ Represents each third-level heading that multiple guidelines are grouped under.
92
92
Each group is defined in a JSON file, with its child guidelines located in a
93
93
subdirectory with the same name.
94
94
95
- - Supports common fields: ` children ` , ` status `
95
+ - Supports [ common fields] ( #common-fields ) : ` children ` , ` status `
96
96
- No additional unique fields
97
97
98
98
#### Guidelines
@@ -101,17 +101,19 @@ Represents each fourth-level heading that multiple requirements/assertions are
101
101
listed under. Each guideline is defined in a Markdown file, with its child
102
102
requirements/assertions located in a subdirectory with the same name.
103
103
104
- - Supports common fields: ` children ` , ` howto ` , ` status ` , ` title `
104
+ - Supports [ common fields] ( #common-fields ) : ` children ` , ` howto ` , ` status ` , ` title `
105
105
- No additional unique fields
106
106
107
107
#### Requirements and Assertions
108
108
109
109
Represents each fifth-level heading specifying an individual requirement or assertion.
110
110
111
- - Supports common fields: ` howto ` , ` status ` , ` title `
111
+ - Supports [ common fields] ( #common-fields ) : ` howto ` , ` status ` , ` title `
112
112
- ` needsAdditionalResearch ` - Optional boolean, indicating whether to
113
113
display a "needs additional research" editor's note
114
114
- ` type ` - Optional string: ` foundational ` , ` supplemental ` , or ` assertion `
115
+ - If not specified, the entry will be rendered as "Requirement"
116
+ (with neither "Foundational" nor "Supplemental" qualification)
115
117
116
118
#### Terms
117
119
@@ -126,7 +128,7 @@ Represents each `dt`/`dd` pair appearing in the Glossary section.
126
128
127
129
### Additional Markdown features
128
130
129
- #### Definition lists
131
+ #### Definition Lists
130
132
131
133
Definition lists can be specified directly in Markdown via the following format:
132
134
@@ -143,11 +145,11 @@ Another shared term
143
145
: Another shared definition
144
146
```
145
147
146
- ### Custom directives for guidelines Markdown
148
+ ### Custom Directives for Guidelines Markdown
147
149
148
150
For more concrete examples, search for these directives in the repository.
149
151
150
- #### Decision trees
152
+ #### Decision Trees
151
153
152
154
The following block will be transformed into a decision tree ` details ` element,
153
155
with "Which foundational requirements apply" summary automatically included:
@@ -193,7 +195,7 @@ Your content here
193
195
:::
194
196
```
195
197
196
- #### Glossary term references
198
+ #### Glossary Term References
197
199
198
200
The text inside ` :term[...] ` will be transformed into a link referencing a term in the glossary,
199
201
and can be used inline within blocks of text:
@@ -202,6 +204,106 @@ and can be used inline within blocks of text:
202
204
... is :term[programmatically determinable].
203
205
```
204
206
207
+ ## Creating New Entries
208
+
209
+ General notes:
210
+
211
+ - All instructions/examples in this section operate within the ` guidelines ` folder
212
+ - File and folder names should be in [ kebab-case] ( https://developer.mozilla.org/en-US/docs/Glossary/Kebab_case ) (all lowercase, hyphen-delimited)
213
+ - [ See ` title ` under Common Fields] ( #common-fields ) above regarding how
214
+ entry names map to titles by default, and how to override with a custom title
215
+ - Remember to add appropriate frontmatter; see the subsection under
216
+ [ Supported Fields] ( #supported-fields ) for the relevant entry type
217
+ - Other existing entries may be helpful to look at as examples, especially with
218
+ regard to JSON or frontmatter syntax
219
+
220
+ ### New Group
221
+
222
+ For illustrative purposes, this refers to the new group as ` group-name ` .
223
+
224
+ To create a new top-level group:
225
+
226
+ 1 . Under the ` groups ` folder, create a subfolder for the new group
227
+ (e.g. ` groups/group-name ` )
228
+ 1 . Also under the ` groups ` folder (not the new subfolder),
229
+ create a JSON file with the same basename as the new subfolder
230
+ (e.g. ` groups/group-name.json ` ), with the following content:
231
+ ``` json
232
+ {
233
+ "children" : [
234
+ ]
235
+ }
236
+ ```
237
+ 1 . Edit ` index.json ` (directory under the top-level ` guidelines ` folder)
238
+ to add an entry in its ` children ` array for the new group
239
+ (again using the same basename, e.g. ` group-name ` )
240
+ - This is what makes the group appear in the document structure,
241
+ and determines its order among the other top-level groups
242
+ 1 . Follow the instructions below to create at least one guideline
243
+ within the group, and at least one requirement or assertion within
244
+ each guideline
245
+
246
+ ### New Guideline
247
+
248
+ For illustrative purposes, this refers to the existing parent group as ` group-name `
249
+ and the new child guideline as ` guideline-name ` .
250
+
251
+ To create a new guideline:
252
+
253
+ 1 . Under the desired group's folder, create a subfolder for the guideline
254
+ (e.g. ` groups/group-name/guideline-name ` )
255
+ 1 . Edit the JSON file for the group (e.g. ` groups/group-name.json ` )
256
+ to add an entry in its ` children ` array for the new guideline
257
+ (again using the same basename, e.g. ` guideline-name ` )
258
+ - This is what makes the guideline appear in the document structure,
259
+ and determines its order among the other guidelines under the same group
260
+ 1 . Also under the group's folder (not the new subfolder),
261
+ create a Markdown file with the same basename as the new subfolder
262
+ (e.g. ` groups/group-name/guideline-name.md ` )
263
+ - To prevent the build from failing before any requirements or assertions are added,
264
+ include the following initial content:
265
+ ```
266
+ ---
267
+ children: []
268
+ ---
269
+
270
+ @@ add guideline text here
271
+
272
+ ```
273
+ We will expand `children` to a multi-line list when adding requirements/assertions.
274
+ Note that including some content after the frontmatter is also necessary for the build to function.
275
+ 1. Follow the instructions below to create at least one requirement
276
+ or assertion within the guideline
277
+
278
+ ### New Requirement or Assertion
279
+
280
+ For illustrative purposes, this refers to the existing parent guideline as `guideline-name`,
281
+ its parent group as `group-name`, and the new child requirement as `requirement-name`.
282
+
283
+ Note that the process is the same for requirements or assertions; the only difference is
284
+ the value of `type` in the entry's frontmatter
285
+ (see [Fields for Requirements and Assertions](#requirements-and-assertions)).
286
+
287
+ 1. Under the desired guideline's folder, create a Markdown file
288
+ (e.g. `groups/group-name/guideline-name/requirement-name.md`)
289
+ 1. Edit the Markdown file for the guideline (e.g. `groups/group-name/guideline-name.md`)
290
+ to add an entry in its `children` array for the new guideline
291
+ - This is what makes the requirement/assertion appear in the document structure,
292
+ and determines its order among the other entries under the same guideline
293
+ - Arrays in frontmatter can be expressed similarly to Markdown lists, e.g.:
294
+ ```
295
+ ---
296
+ children:
297
+ - requirement-name
298
+ ---
299
+ ```
300
+
301
+ ### New Term
302
+
303
+ Creating a glossary term is more straightforward, since there is no hierarchy:
304
+ create a Markdown file under `terms`, then populate its content and any applicable
305
+ [frontmatter](#terms).
306
+
205
307
## Environment Variables
206
308
207
309
### `WCAG_DIFFABLE`
0 commit comments