Giter VIP home page Giter VIP logo

Comments (10)

whymarrh avatar whymarrh commented on May 18, 2024

I am willing to submit a PR.

from pa11y.

rowanmanning avatar rowanmanning commented on May 18, 2024

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.

whymarrh avatar whymarrh commented on May 18, 2024

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):

  1. Write out a temp JSON config file and pass just one argument:

    --config=/tmp/config.json
    
  2. 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.

whymarrh avatar whymarrh commented on May 18, 2024

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.

whymarrh avatar whymarrh commented on May 18, 2024

Any new thoughts on what's above?

from pa11y.

rowanmanning avatar rowanmanning commented on May 18, 2024

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.

whymarrh avatar whymarrh commented on May 18, 2024

@rowanmanning no worries!

I'm definitely still willing to submit a PR for this.

from pa11y.

rowanmanning avatar rowanmanning commented on May 18, 2024

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.

rowanmanning avatar rowanmanning commented on May 18, 2024

@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.

whymarrh avatar whymarrh commented on May 18, 2024

Sure can!

from pa11y.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.