Skip to content

Commit

Permalink
add Quick start
Browse files Browse the repository at this point in the history
  • Loading branch information
yaniswang committed Oct 7, 2015
1 parent 2247853 commit 8c498ee
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,41 @@ HTMLHint is a Static Code Analysis Tool for HTML, you can use it with IDE or in

Official Site: [http://htmlhint.com/](http://htmlhint.com/)

Quick start
======================

1. install & hint

npm install htmlhint -g
htmlhint -V
htmlhint --help
htmlhint test.html

2. result

test.html
L5 | </head>
^ <title> must be present in <head> tag. (title-require)
L8 | </body>
^ Tag must be paired, missing: [ </div> ], start tag match failed [ <div> ] on line 7. (tag-pair)

2 errors in 1 files

3. config rules

search `.htmlhintrc` file in current directory and all parents directory:

htmlhint
htmlhint test.html

custom config file:

htmlhint --config htmlhint.conf test.html

custom rules:

htmlhint --rules tag-pair,id-class-value=underline test.html

Guide
=======================

Expand Down
7 changes: 3 additions & 4 deletions bin/htmlhint
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,11 @@ quit(processFiles(arrAllFiles, ruleset, jsonOutput));
function listRules(){
var rules = HTMLHint.rules;
var rule;
console.log('\r\nAll rules:');
console.log('======================================');
console.log(' All rules:');
console.log(' ==================================================');
for (var id in rules){
rule = rules[id];
console.log('\r\n'+rule.id+' :');
console.log(' '+rule.description);
console.log(' %s : %s', rule.id.green, rule.description);
}
}

Expand Down

0 comments on commit 8c498ee

Please sign in to comment.