diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..d772ffb --- /dev/null +++ b/README.md @@ -0,0 +1,50 @@ +# w3c-validator + +The `w3c-validator.py` script uses the `curl(1)` command to submit +HTML files and URLs to the [W3C Markup Validation Service](https://validator.w3.org/) +and CSS files and URLs to the [W3C CSS Validation Service](https://jigsaw.w3.org/css-validator/). +The script parses and reports the JSON results returned by validators. + +## Requirements +- Python +- Curl +- An Internet connection + +## Usage + +The script command syntax is: + + python w3c-validator.py [--verbose] FILE|URL... + +- The optional `--verbose` option will print information about what is + going on internally. +- Names with a `.css` extension are treated as CSS, all other names + are assumed to contain HTML. +- Names starting with `https://` are assumed to be publically + accessible URLs, all other names are assumed to be local file names. +- Any mix of one or more local files or HTTP URLs can be specified. +- If one or more files fail validation then the exit status will be 1, + if no errors occurs the exits status will be zero. + +Examples: + +```bash +$ w3c-validator tests/data/something-html5-file.html +validating: tests/data/something-html5-file.html ... +error: line 822: The tt element is obsolete. Use CSS instead. +``` + + +```bash +$ w3c-validator https://www.methods.co.nz/asciidoc/layout1.css +validating: https://www.methods.co.nz/asciidoc/layout1.css ... +``` + + +## References +- [User's guide for the W3C Markup Validator](https://validator.w3.org/docs/users.html) +- [CSS Validator User's Manual](https://jigsaw.w3.org/css-validator/manual.html) + + +## License +This work is licensed under the [GNU GPLv3+](LICENSE) |