Giter VIP home page Giter VIP logo

w3c-validator's Introduction

W3C HTML Validator

This is a PHP library to validate HTML using the W3C HTML Validator API (non-official). It includes a checkstyle.xml formatter, which can be used in continuous integration systems.

Installation

Install with composer:

php composer.phar require-dev micheh/w3c-validator:0.*

Usage

Run the w3c-validator.php file in the bin directory and provide a url or path to the HTML file, which should be validated with the W3C Validator. If a url is provided, it will grab the html locally and submit it to the validator, which enables you to validate a local page as well. The script will exit with error code 0 if no errors or warnings are found, and exit code 1 if there is at least one error and/or warning.

To create a checkstyle.xml file with the violations, provide the --report-checkstyle=<path> flag and set the path where the xml file should be saved.

php bin/w3c-validator.php --report-checkstyle=artifacts/checkstyle.xml http://localhost/project1

License

The files in this archive are licensed under the BSD-3-Clause license. You can find a copy of this license in LICENSE.txt.

w3c-validator's People

Contributors

micheh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

w3c-validator's Issues

Command "require-dev" is not defined

I already had composer installed, but when running

composer require-dev micheh/w3c-validator:0.*

I kept getting this error message

[Symfony\Component\Console\Exception\CommandNotFoundException]  
Command "require-dev" is not defined. 

Fixed it by running

composer clearcache
composer install

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.