Git Product home page Git Product logo

node-wcag's Issues

Add "quiet" mode

Sometimes you don't want the entire report. You just want to know if it PASSES (no errors founds) or FAILS. See #8 (comment).

Parse multiple URLs at once

i.e. Let the user do wcag whatever.com anotherwebsite.com foo.com.

I'm not even sure what the output would look like.

Split CLI as separate module

I've always had one module containing both CLI and module. However, after reading this I think it would be better to keep them apart.

$ npm install wcag

Would install the module

$ npm install wcag-cli -g

would install the CLI (much as it is today)

It would still be possible to enable use of wcag as CLI handle

$ wcag <url> --key=<key>

Travis CI failing on `npm install`

Turns out the global installation isn't the problem: https://travis-ci.org/contolini/node-wcag/builds/80614351

$ npm install
npm ERR! Linux 3.13.0-40-generic
npm ERR! argv "/home/travis/.nvm/versions/node/v0.12.7/bin/node" "/home/travis/.nvm/versions/node/v0.12.7/bin/npm" "install"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code E404
npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/repo-templates
npm ERR! 404 
npm ERR! 404 'repo-templates' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'verb'
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! Please include the following file with any support request:
npm ERR!     /home/travis/build/contolini/node-wcag/npm-debug.log
The command "npm install" failed and exited with 1 during .
Your build has been stopped.

wat.

Check if supplied URL is valid

Use the valid-url module

var validUrl = require('valid-url')

if (opts.uri && !validUrl.isWebUri(opts.uri)) {
    return callback(new Error('You supplied an invalid URL.'), null);
}

Find a way to make reporting less verbose

Some sites report hundreds of potential problems which can be overwhelming to scroll through. The problems often have the same message but occur on different lines.

Maybe we should cap the list by default. Something like:

  ⚠  499 potential problems found.

  ⚠  183:70 Anchor text may not identify the link destination.
  ⚠  183:174 Anchor text may not identify the link destination.
  ⚠  183:243 Anchor text may not identify the link destination.
  ⚠  183:295 Anchor text may not identify the link destination.
  ⚠  183:351 Anchor text may not identify the link destination.
  ⚠  183:409 Anchor text may not identify the link destination.
  ⚠  183:467 Anchor text may not identify the link destination.
  ⚠  183:522 Anchor text may not identify the link destination.
  ⚠  183:579 Anchor text may not identify the link destination.
  ⚠  183:638 Anchor text may not identify the link destination.
  ⚠  183:694 Anchor text may not identify the link destination.
  ⚠  183:749 Anchor text may not identify the link destination.

  487 additional problems not shown. Run with `--verbose` to show full list.

Or maybe we should just group similar errors?

  ⚠ 183:70, 183:174, 183:243, 183:295, 183:351, 183:409, 183:467, 183:522, 183:579, 183:638, 183:694, 183:749 Anchor text may not identify the link destination.

Or:

  ⚠ Anchor text may not identify the link destination. Occurs at 183:70, 183:174, 183:243, 183:295, 183:351, 183:409, 183:467, 183:522, 183:579, 183:638, 183:694, 183:749.

Example of the problem:

screen shot 2015-05-29 at 2 17 13 pm

Abort on bad websites

If a request doesn't return 200, tell the user they supplied a bad URL.

http.get('http://thisisnotalegitimatewebsite.foo').on('error', function() {
  console.log("You supplied an invalid URL.");
});

No way to obtain an AChecker API ID - is this project alive?

CLI requires an AChecker API id:

$ wcag domainname.com
Please provide an AChecker API ID with `--id` or setting an `ACHECKER_ID` environment variable. Register at http://achecker.ca/register.php to get an ID.

http://achecker.ca/register.php returns 404, it looks like the original service is no longer there.

What is the status of this project? Any hope of getting it back to a useful state?

Error: Unable to connect to undefined

I haven't had the time to look into this, but here's what I've got so far.

$ wcag https://www.mrfylke.no/ --id=69f6ea6a9e30b37c3d341d3b716df218f8942c0e

Returns

Error: Unable to connect to undefined

The same error message is returned from the module.

'use strict';

var wcag = require('wcag');
var options = {
  id: '69f6ea6a9e30b37c3d341d3b716df218f8942c0e',
  uri: 'https://www.mrfylke.no',
  guide: 'WCAG2-AA'
};

wcag(options, function (error, data) {
  if (error) {
    console.error(error);
  } else {
    console.log(data);
  }
});

//=> [Error: Unable to connect to undefined]

So far I've only seen this error with this url. If you check the url via the achecker websites everything is ok. The error message itself seems to be returned from lib/checkURI.js so that's probably a good place to start.

Switch from xml2json to xml2js

xml2js is a parser written in pure JavaScript so the node-gyp buildstep we get by using xml2json will no longer be necessary.

Haven't looked into if we can just switch or if it requires a lot of extra work.

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.