Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specifying custom script files for the runners #543

Open
Zauberbutter opened this issue Nov 26, 2020 · 2 comments
Open

Specifying custom script files for the runners #543

Zauberbutter opened this issue Nov 26, 2020 · 2 comments

Comments

@Zauberbutter
Copy link

The HTML Codesniffer and aXe have localized versions and you are able to write your own, so it would be nice to provide a custom script for the runners without the need to provide the whole runner yourself.

@josebolos
Copy link
Member

Hi @Cerberooo

Thanks for creating this issue. Could you expand a bit on your request? What are you asking for, and how it should work?

@josebolos josebolos added the status: waiting for input Waiting for more information from the original user label Nov 26, 2020
@Zauberbutter
Copy link
Author

Zauberbutter commented Nov 26, 2020

So maybe the runners attribute inside the options object needs to be an object itself. To specify your custom file you could use it like so:

const results = await pa11y(url, {
    runners: {
        htmlcs: {
            scripts: ['./HTMLCS.js']
        }
    }
});

Now you can build your own script file with the localization you want and the runner will use this file instead of the default one. The function name and structure of the new files output will stay the same, so there is no need to change anything other than the script file in the runner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants