Bring back :doc task

which has been removed at 11bb81149f
but still in need for generating a complete set of haml.info docs
This commit is contained in:
Akira Matsuda 2022-09-23 11:42:25 +09:00
parent c6e3f85a17
commit 7727346a49
No known key found for this signature in database
1 changed files with 25 additions and 0 deletions

View File

@ -112,5 +112,30 @@ task bench: :compile do
exit system(*cmd)
end
namespace :doc do
task :sass do
require 'sass'
Dir["yard/default/**/*.sass"].each do |sass|
File.open(sass.gsub(/sass$/, 'css'), 'w') do |f|
f.write(Sass::Engine.new(File.read(sass)).render)
end
end
end
desc "List all undocumented methods and classes."
task :undocumented do
command = 'yard --list --query '
command << '"object.docstring.blank? && '
command << '!(object.type == :method && object.is_alias?)"'
sh command
end
end
desc "Generate documentation"
task(:doc => 'doc:sass') {sh "yard"}
desc "Generate documentation incrementally"
task(:redoc) {sh "yard -c"}
task default: %w[compile hamlit:test]
task test: %w[compile test:all]