After a long wait, nanoc 3.2 has been released. Major new points in this release include speed improvements, custom commands and a handful of new and updated filters. Check the full release notes for details.
To update your nanoc install, simply
% gem install nanoc
Below is an example of how to write custom commands for nanoc. You can use this to create your own HTML/CSS validation commands, deploy commands, blog maintenance commands and more. Read the writing commands section of the manual for details.
usage 'dostuff [options]'
aliases :ds, :stuff
summary 'does stuff'
description 'This command does a lot of stuff. I really mean a lot.'
flag :h, :help, 'show help for this command' do |value, cmd|
puts cmd.help
exit 0
end
flag :m, :more, 'do even more stuff'
option :s, :stuff, 'specify stuff to do', :argument => :optional
run do |opts, args, cmd|
stuff = opts[:stuff] || 'generic stuff'
puts "Doing #{stuff}!"
if opts[:more]
puts 'Doing it even more!'
end
end
If you have any questions, be sure to ask them on the mailinglist. If you encounter issues, please do report them at the issue tracker—thanks! You can also find me (and others) on the nanoc IRC channel.
Enjoy!