Natural Docs rake task
Posted by Steve on June 09, 2006|Comments
Recently I’ve been working on a Javascript heavy app for a client. In order to document the 2000+ lines Javascript in the project I used Natural Docs.
Here’s the meat for rake task to allow you to generate docs for a project:
begin
namespace :naturaldocs do
task :generate do
sh %{mkdir -p ../docs/.nd && naturaldocs -i . -o html ../docs -p ../docs/.nd} do |ok, res|
if ok
puts “Documents generated successfully in ../docs.”
else
puts “Couldn’t generate documentation, have you installed naturaldocs? (sudo apt-get install naturaldocs).”
end
end
end
end
end