nanoc-tidy.rb is a
nanoc
filter that integrates
tidy-html5
into nanoc.
The filter can format and validate HTML produced
during the
nanoc
build process.
Defaults
The following example executes tidy with the default settings.
See Nanoc::Tidy.default_argv
for more details:
# Rules
require "nanoc-tidy"
compile "/index.html.erb" do
layout("/default.*")
filter(:erb)
filter(:tidy)
write("/index.html")
end
Option: argv
The following example sets the "argv" filter option.
The filter option is combined with
Nanoc::Tidy.default_argv:
# Rules
require "nanoc-tidy"
compile "/index.html.erb" do
layout("/default.*")
filter(:erb)
filter(:tidy, argv: ["-upper"])
write("/index.html")
end
Option: exe
The "exe" option can be used to change the default executable from "tidy5" to something else, the most common alternative might be "tidy":
# Rules
require "nanoc-tidy"
compile "/index.html.erb" do
layout("/default.*")
filter(:erb)
filter(:tidy, exe: "tidy")
write("/index.html")
end
Rubygems.org
nanoc-tidy.rb can be installed via rubygems.org:
gem install nanoc-tidy.rb