Class: Nanoc3::Extra::Validators::W3C
Nanoc3::Extra::Validators::W3C is a validator that uses the W3C web service to validate HTML and CSS files.
Constructor Summary
public
initialize(site, type)
[View source]
9 10 11 12 |
# File 'lib/nanoc3/extra/validators/w3c.rb', line 9 def initialize(site, type) @site = site @type = type end |
Public Visibility
Public Instance Method Summary
| #run |
|---|
Public Instance Method Details
run
public
run
[View source]
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/nanoc3/extra/validators/w3c.rb', line 14 def run # Load validator require 'w3c_validators' # Make sure config is loaded @site.load_data # Find all files files = extensions.map { |extension| Dir["#{@site.config[:output_dir]}/**/*.#{extension}"] }.flatten # Validate each file files.each do |file| validation_started(file) results = validator.validate_file(file) validation_ended(file, results.errors) end end |