Comments (10)
I am willing to submit a PR.
from pa11y.
Yes, I think this is a great idea, and would be more than willing to merge in. As to which command-line args we allow, do you think a flat list somewhere would make sense? Just to prevent use of help
etc? The only downside with that is that we'd have to add new flags by name as Phantom adds them.
from pa11y.
I'm not sure I understand the questions fully, so please forgive me if I'm talking about something seemingly random.
The command line flags for pa11y can be listed out via --help
and in the README file. These options can be added/removed as their command line counterparts change. What I'm thinking is that, when using the API:
var pa11y = require('pa11y');
pa11y.sniff(options, callback);
One should be able to save something resembling options
to a JSON file and pass it to:
pa11y --config $filename $site
For PhantomJS arguments, I think there may be two ways to pass the options dynamically (to avoid having to keep the supported options up to date):
-
Write out a temp JSON config file and pass just one argument:
--config=/tmp/config.json
-
Since "[the PhantomJS config file] keys are de-dashed, camel-cased equivalents of the other supported command-line options", we could just reverse that process, prepend
--
, and pass the arguments along.Something like so:
"localStorageQuota".replace(/([a-z])([A-Z])/g, function (match, p1, p2) { return g + "-" + e.toLowerCase(); }); // "local-storage-quota"
I'm not sure if either of the above are particularly elegant, but they might work.
from pa11y.
The last snippet in my comment above should actually read:
"localStorageQuota".replace(/([a-z])([A-Z])/g, function (match, p1, p2) {
return p1 + "-" + p2.toLowerCase();
});
from pa11y.
Any new thoughts on what's above?
from pa11y.
Hi @whymarrh, sorry – this has been marked as unread, I've had no free time to work on pa11y and I've let the issues get ahead of me! Based on your longer reply, I think I was getting the wrong end of the stick before, and this would definitely be really useful.
Is it something you're keen to work on?
from pa11y.
@rowanmanning no worries!
I'm definitely still willing to submit a PR for this.
from pa11y.
Just a note, this has made it into a development version of pa11y, support for configuring any PhantomJS flag (not necessarily through a config file, but it works anyway). There's no ETA yet but I'll keep you posted.
from pa11y.
@whymarrh can this issue close based on the new 2.0 API (where you can configure everything from the JSON config if you need to)?
from pa11y.
Sure can!
from pa11y.
Related Issues (20)
- Can we get violations defects for after login pages using pa11y? HOT 2
- TimeoutError: Pa11y timed out HOT 6
- Inconsistencies between pa11y and other accessibility tools HOT 1
- Axe runner doesn't include wcag2aaa tag when standard is set to WCAG2AAA. HOT 2
- How do I include multiple Urls in 1 report? HOT 7
- Can I include a config file for a report? HOT 2
- Error reporting during installation HOT 1
- rules option ignored HOT 1
- Documented require() for reporters doesn't work HOT 3
- Error: Could not find expected browser (chrome) locally. Run `npm install` to download the correct Chromium revision (869685) HOT 5
- Is pa11y still maintained? HOT 6
- Fails to run once `core-js` is removed from the page. HOT 3
- Retrieving the number of items that pass the checks per rule HOT 1
- Version 7.0.0 requires an unsupported version of puppeteer HOT 5
- Dark or light mode handling HOT 2
- Certain pages result in "Cannot read properties of undefined (reading 'replace')" HOT 4
- Custom Timeout settings is not working - script is timed out with default 30000 ms HOT 2
- Contrast ratio potential false-positive HOT 1
- Summarise passing test cases HOT 3
- Can pa11y be used as unit tests in CI pipeline and make the build fail? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pa11y.