Skip to content

Commit d76a620

Browse files
committed
* add documentation to script
1 parent d307269 commit d76a620

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

script/axe-docs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/bash
22

3+
# This workflow is intended to help catch accesibility violations by running axe on every documentation example.
4+
# Developers frequently copy and paste examples from documentation so it's important to ensure the examples are
5+
# accessible.
6+
# Learn more about @axe-core/cli here: https://github.com/dequelabs/axe-core-npm/tree/develop/packages/cli
7+
38
npm install -g @axe-core/cli
49

510
# https://stackoverflow.com/a/21189044
@@ -27,11 +32,11 @@ containsElement () {
2732
return 1
2833
}
2934

30-
# Find all paths for component or utilities pages because they contain examples.
35+
# Finds all paths for component or utilities pages because they contain examples.
3136
nav_paths=($(parse_yaml docs/src/@primer/gatsby-theme-doctocat/nav.yml | grep -e "/components/" -e "/utilities/" | awk -F "=" '{print $2}'))
3237

3338
# Starting point violations
34-
# DO NOT ADD TO THIS LIST
39+
# DO NOT ADD TO THIS LIST!
3540
needs_to_be_fixed=(
3641
/components/autocomplete
3742
/components/avatars
@@ -69,7 +74,5 @@ do
6974
done
7075

7176
# https://github.com/dequelabs/axe-core-npm/tree/develop/packages/cli
72-
# We exclude axe rules that depend on full page context.
73-
# axe ${doc_urls[@]} --include "iframe" --disable html-has-lang,frame-title,page-has-heading-one,region,color-contrast,landmark-unique,landmark-one-main --exit --show-errors
74-
77+
# We exclude rules that depend on full page context.
7578
axe ${doc_urls[@]} --include "iframe" --disable html-has-lang,frame-title,page-has-heading-one,region,color-contrast,landmark-unique,landmark-one-main --show-errors

0 commit comments

Comments
 (0)