Accessify makes use of Accessibility Theme Builder SDK and WCAG Accessibility Guidelines to provide feedback to developers during development on areas where the product is failing to meet accessibility standards.
Code for this project can be found within the code folder.
The code/cli
and code/vscode-extension
folders contain the relevant code required to run Accessify as a Command Line Interface (CLI) and a Visual Studio Code (VSCode) Extension, repectively.
The code/sdk
folder contains code for Accessify's Software Development Kit (SDK), which serves as the backbone of the Accessify tool. It validates the user's HTML
based on specified rules and requirements.
This project requires NodeJS (version 8 or later) and NPM. Node and NPM are really easy to install. To make sure you have them available on your machine, try running the following command.
$ npm -v && node -v
To use the Accessify tool, you have to first build the Accessify SDK
. This can be achieved by following the steps below.
- Open the project folder
- Navigate to the
hackproject/code/sdk
folder. - Run the following command to install the dependencies:
$ npm install
- Build the SDK by running the following command:
This will generate a
$ npm run build
build
folder that will be used by both the CLI and the VSCode Extension.
The following steps assume you have opened a UNIX-based terminal
-
Open the project folder in your terminal.
-
Navigate to the
hackproject/code/cli
folder. -
Run the following command to install the dependencies:
$ npm install
-
Set execution permission on the
./run.sh
file by using the following command, allowing it to be run as a program.$ chmod +x ./run.sh
-
Validate your required
HTML
file or entire directory based on specified options with their respective values using the following command.$ ./run.sh <path-to-file-or-directory> [options]
options
--css # Specify path to a CSS file --validator # Specify what type of validation to use. Options: {contrast | typography | attribute | all} (default: all) --requirement # Specify the type WCAG requirement to validate by {AA | AAA} (default: AA)
examples
- Validate
./static/index.html
using the default options and no other CSS file.$ ./run.sh ./static/index.html
- Use the
contrast
validator for./static/index.html
using the./static/style.css
.$ ./run.sh ./static/index.html --css ./static/style.css --validator contrast
- Validate all
HTML
files in the./static/
directory using the WCAG AAA Requirements.$ ./run.sh ./static --requirement AAA
- Validate
The following steps assume you have already installed VSCode on your computer.
-
Open an new VSCode window.
-
Open the
hackproject/code/vscode-extension
folder in VSCode so that the.vscode
folder is at the root of your VSCode workspace, as shown in the image below.
-
Right-click on the VSCode File Explorer and select Open in Integrated Terminal. This should open a terminal where you can run commands.
-
Ensure that Accessify is compatible with your VSCode by doing the following.
- Check your VSCode version.
- Open the
package.json
file and verify thatengines.vscode
is set to^your-vscode-version-or-lower
. For example, if your VSCode version is1.78.0
, thenengines.vscode
should be set to^1.78.0
,^1.77.0
,^1.73.0
, or a lower version. You can find your VSCode version by running the following command in the terminal:$ code --version
-
Run the following command to install the dependencies:
$ npm install
-
Compile the VSCode Extension by running the following command:
$ npm run compile
At this point, please ensure that your folder structure looks like this:
/ │ .eslintrc.json │ .gitignore │ .vscodeignore │ CHANGELOG.md │ package-lock.json │ package.json │ README.md │ tsconfig.json │ vsc-extension-quickstart.md ├───.vscode ├───node_modules ├───out └───src
-
Inside your VSCode editor, press
F5
. This will run the extension in a new Extension Development Host window, and you should seeAccessify is now active!
in yourDEBUG CONSOLE
. -
In the new Extension Development Host window, Press
Ctrl+Shift+P
to open the Command Palette. -
Type
Accessify
in the search box and selectAccessify
from the list of commands. -
If everything is set up correctly, your
HTML
file will be validated by Accessify. HTML elements in the current.html
file with accessibility issues will be highlighted, and when you hover over them, you should see a tooltip with the issue. Here's an example image of how the output might look like: