Sha256: 768f37e276aaf449eaf76d1ddcbbc215c593fb827944103b861483fd31e0547a

Contents?: true

Size: 882 Bytes

Versions: 12

Compression:

Stored size: 882 Bytes

Contents

# encoding: utf-8

namespace :validate do

  desc 'Validate the site\'s HTML files'
  task :html do
    # Load site
    site = Nanoc3::Site.new('.')
    if site.nil?
      $stderr.puts 'The current working directory does not seem to be a ' +
                   'valid/complete nanoc site directory; aborting.'
      exit 1
    end

    # Validate
    validator = ::Nanoc3::Extra::Validators::W3C.new(site, :html)
    validator.run
  end

  desc 'Validate the site\'s CSS files'
  task :css do
    # Load site
    site = Nanoc3::Site.new(YAML.load_file(File.join(Dir.getwd, 'config.yaml')))
    if site.nil?
      $stderr.puts 'The current working directory does not seem to be a ' +
                   'valid/complete nanoc site directory; aborting.'
      exit 1
    end

    # Validate
    validator = ::Nanoc3::Extra::Validators::W3C.new(site, :css)
    validator.run
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
nanoc3-3.0.9 lib/nanoc3/tasks/validate.rake
nanoc3-3.0.8 lib/nanoc3/tasks/validate.rake
nanoc3-3.1.0a2 lib/nanoc3/tasks/validate.rake
nanoc3-3.1.0a1 lib/nanoc3/tasks/validate.rake
nanoc3-3.0.7 lib/nanoc3/tasks/validate.rake
nanoc3-3.0.6 lib/nanoc3/tasks/validate.rake
nanoc3-3.0.5 lib/nanoc3/tasks/validate.rake
nanoc3-3.0.4 lib/nanoc3/tasks/validate.rake
nanoc3-3.0.3 lib/nanoc3/tasks/validate.rake
nanoc3-3.0.2 lib/nanoc3/tasks/validate.rake
nanoc3-3.0.1 lib/nanoc3/tasks/validate.rake
nanoc3-3.0.0 lib/nanoc3/tasks/validate.rake