Skip to content

Commit 8d1a2b0

Browse files
authored
Move json generation script to subfolder with its own README (#4635)
This gives us a dedicated place to document wcag.json and where it is published. I re-ran the build with `WCAG_JSON=1` to confirm that moving the script still works correctly; output is unchanged.
1 parent 2b4cbd4 commit 8d1a2b0

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

11ty/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ Generates `_site/wcag.json`. (This is not done by default, as it adds to build t
183183

184184
**Default:** Unset by default; `publish-w3c` scripts set this to a non-empty value.
185185

186+
For more information on the output, see [11ty/json/README.md](json#readme).
187+
186188
### `GITHUB_REPOSITORY`
187189

188190
**Usage context:** Automatically set during GitHub workflows; should not need to be set manually

11ty/json/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# JSON Serialization of WCAG 2
2+
3+
The script in this folder serializes WCAG 2 information into JSON format, including:
4+
5+
- Principles, guidelines, and success criteria
6+
- Glossary terms
7+
- Associations between (normative) success criteria and (informative) techniques
8+
9+
The following JSON files are published monthly:
10+
11+
- [WCAG 2.2 JSON](https://www.w3.org/WAI/WCAG22/wcag.json)
12+
- [WCAG 2.1 JSON](https://www.w3.org/WAI/WCAG21/wcag.json)
13+
14+
For a history of structural changes to the JSON files, see the [list of merged wcag.json pull requests](https://github.com/w3c/wcag/pulls?q=is%3Apr+label%3Awcag.json), and in particular the "wcag.json Changes" section in each pull request description.
15+
16+
## Permission to use with attribution
17+
18+
You may use this data, in full or in part, provided you:
19+
20+
- Clearly attribute the original source and include a link to it ([Web Content Accessibility Guidelines (WCAG) 2.2](https://www.w3.org/TR/WCAG22/), [Techniques for WCAG 2.2](https://www.w3.org/WAI/WCAG22/Techniques/), [Web Content Accessibility Guidelines (WCAG) 2.1](https://www.w3.org/TR/WCAG21/), [Techniques for WCAG 2.1](https://www.w3.org/WAI/WCAG21/Techniques/))
21+
- Do not change the content
22+
23+
If you include additional information, it must be clear what is from the W3C WCAG documents and what is added.
24+
25+
See [W3C Document license](https://www.w3.org/copyright/document-license/) and [W3C Intellectual rights](https://www.w3.org/copyright/intellectual-rights/), particularly '[May I annotate one of your specifications?](https://www.w3.org/copyright/intellectual-rights/#annotate)'.

11ty/json.ts renamed to 11ty/json/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import type {
1414
} from "understanding/understanding";
1515
import eleventyUnderstanding from "understanding/understanding.11tydata";
1616

17-
import { type CheerioAnyNode } from "./cheerio";
18-
import { resolveDecimalVersion } from "./common";
17+
import { type CheerioAnyNode } from "../cheerio";
18+
import { resolveDecimalVersion } from "../common";
1919
import {
2020
type SuccessCriterion,
2121
type WcagVersion,
@@ -25,7 +25,7 @@ import {
2525
assertIsWcagVersion,
2626
getFlatGuidelines,
2727
generateScSlugOverrides,
28-
} from "./guidelines";
28+
} from "../guidelines";
2929
import {
3030
expandTechniqueToObject,
3131
getFlatTechniques,
@@ -34,7 +34,7 @@ import {
3434
type Technique,
3535
type TechniqueAssociationType,
3636
type Technology,
37-
} from "./techniques";
37+
} from "../techniques";
3838

3939
const removeNewlines = (str: string) => str.trim().replace(/\n\s+/g, " ");
4040

0 commit comments

Comments
 (0)