stevenwoodson / wcag2json

JSON versions of WCAG 2 and it's translations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WCAG 2 JSON

Originally developed by Wilco Fiers in 2015, this package downloads a webpage and scrapes it for WCAG success criteria content based on a very particular HTML format shared among the various available language translations.

Updated in 2022 by Steve Woodson to also scrape WCAG 2.1 in addition to the existing WCAG 2.0 parser.

Usage

Start by running npm install to install the dependencies.

The primary script for this package is:

npm run scrape [language] [version]

  • [language] is a two character language code
  • [version] is either 20 for WCAG 2.0 or 21 for WCAG 2.1.

The list of currently available translation sources is stored in translations.json organized first by WCAG version and then by language code. These translation URLs came from https://www.w3.org/WAI/standards-guidelines/wcag/translations/

Results

When the scrape command is complete, you'll have an HTML file in the respective wcag2x-html folder and a JSON file in the respective wcag2x-json folder.

The HTML is the downloaded file from the translation URL and the JSON file is that HTML file parsed into a JSON format.

Disclaimer

Due to the transient nature of the web and lack of multilingual support, there's no guarantees that the content gathered is always going to work nor that it will be 100% accurate. If the JSON generated by this package is to be used in mission critical properties it's advisable to use this as a starting point and have it validated by a professional.

About

JSON versions of WCAG 2 and it's translations


Languages

Language:JavaScript 100.0%