html_validation 0.5.5 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +12 -10
- data/lib/html_validation/version.rb +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -16,9 +16,7 @@ barring that, review and accept any errors and warnings.
|
|
16
16
|
The current (as of March 2013) default version of Tidy doesn't support HTML 5.
|
17
17
|
To get HTML 5 support, install this fork of tidy: https://github.com/w3c/tidy-html5
|
18
18
|
|
19
|
-
Be sure to get rid of the old tidy first if you have it already.
|
20
|
-
|
21
|
-
Debian flavors: sudo apt-get remove tidy
|
19
|
+
Be sure to get rid of the old tidy first if you have it already. on Debian variants: sudo apt-get remove tidy
|
22
20
|
|
23
21
|
Download the repo as a zip file and extract somewhere, then follow the instructions
|
24
22
|
given on the page (using sudo for make commands if on Linux).
|
@@ -36,17 +34,19 @@ On linux/OS X machines, confirm the right installation path using: which tidy
|
|
36
34
|
page.should have_valid_html
|
37
35
|
|
38
36
|
It can be convenient to see the html printed in the RSpec failure messages.
|
39
|
-
To
|
37
|
+
To set this feature (globally for all):
|
40
38
|
|
41
39
|
HaveValidHTML.show_html_in_failures = true
|
42
40
|
|
43
41
|
|
44
|
-
All tidy flags, including using a config file can be
|
42
|
+
All tidy flags, including using a config file can be handled.
|
45
43
|
|
46
44
|
A shortcut to disable Tidy Warning messages (they are on by default)
|
47
45
|
has been created for your convenience. However, some things that might be
|
48
46
|
called "errors" show up as warnings, so the recommended approach is
|
49
|
-
run, then accept the errors / warnings that are noted.
|
47
|
+
run, then accept the errors / warnings that are noted. The shortcut
|
48
|
+
is:
|
49
|
+
|
50
50
|
HTMLValidation.show_warnings = false
|
51
51
|
|
52
52
|
|
@@ -60,7 +60,7 @@ On linux/OS X machines, confirm the right installation path using: which tidy
|
|
60
60
|
v = h.validation("<html>foo</html>", 'http://somesite.com/index.html')
|
61
61
|
|
62
62
|
# Note: The second argument (resource) just serves as an identifier used to
|
63
|
-
# name
|
63
|
+
# name the results files, and no data is actually retrieved for you from on the URL!
|
64
64
|
|
65
65
|
v.valid?
|
66
66
|
-> false
|
@@ -75,18 +75,20 @@ On linux/OS X machines, confirm the right installation path using: which tidy
|
|
75
75
|
v.valid?
|
76
76
|
-> true
|
77
77
|
|
78
|
-
|
78
|
+
After the exceptions string has been accepted, the exceptions
|
79
79
|
are still available in v.exceptions even though valid? will return true.
|
80
80
|
This is so you can print them out, nag yourself, etc.
|
81
81
|
|
82
82
|
The exception string is treated and matched as a whole. The current
|
83
83
|
implementation does not allow partial acceptance of individual
|
84
|
-
results in a result string.
|
84
|
+
results in a result string. However, line numbers are ignored, so there is
|
85
|
+
some flexibility in terms of being able to make changes without re-reviewing
|
86
|
+
what passes. Of course, if your HTML is totally clean, no worries.
|
85
87
|
|
86
88
|
== Accepting Errors / Warnings
|
87
89
|
|
88
90
|
The HTML Validation gem stores failure data per-resource. The results are stored
|
89
|
-
in the data_folder. Typically this is the default folder:
|
91
|
+
in the data_folder. Typically this is the default folder: .validation in the project root.
|
90
92
|
After a validation fails, run the thor task to accept or reject validation exceptions.
|
91
93
|
|
92
94
|
From your project's root folder, run: validation review
|