github.com/nycdavid/zeus@v0.0.0-20201208104106-9ba439429e03/man/Rakefile (about) 1 require 'ronn' 2 3 task default: 'man:gen' 4 5 task clean: 'man:clean' 6 7 namespace :man do 8 directory "build" 9 10 Dir["src/*.ronn"].each do |ronn| 11 basename = File.basename(ronn, ".ronn") 12 roff = "build/#{basename}" 13 14 file roff => ["build", ronn] do 15 sh "#{Gem.ruby} -S ronn --roff --pipe #{ronn} > #{roff}" 16 end 17 18 file "#{roff}.txt" => roff do 19 sh "groff -Wall -mtty-char -mandoc -Tascii #{roff} | col -b > #{roff}.txt" 20 end 21 22 task :build_all_pages => "#{roff}.txt" 23 end 24 25 desc "Build the man pages" 26 task :gen => "man:build_all_pages" 27 28 desc "Clean up from the built man pages" 29 task :clean do 30 rm_rf "build" 31 end 32 end 33