[Docs] rake watch now rebuilds stylesheets independently from docs content so doc styling is faster
This commit is contained in:
parent
46b7343b80
commit
6bbbb94bfa
@ -24,23 +24,28 @@ task :watch do
|
|||||||
end
|
end
|
||||||
|
|
||||||
rebuild_site = lambda do |base, relative|
|
rebuild_site = lambda do |base, relative|
|
||||||
if relative
|
if relative && relative =~ /\.s[ac]ss/
|
||||||
puts ">>> Change Detected to #{relative} <<<"
|
puts ">>> Change Detected to #{relative} : updating stylsheets <<<"
|
||||||
|
system "bundle exec compass compile"
|
||||||
else
|
else
|
||||||
puts ">>> Compiling <<<"
|
if !relative
|
||||||
end
|
puts ">>> Compiling <<<"
|
||||||
start = Time.now
|
else
|
||||||
# Nanoc3::CLI::Base.new.run(["co"])
|
puts ">>> Change Detected to #{relative} <<<"
|
||||||
site = Nanoc3::Site.new('.')
|
end
|
||||||
site.load_data
|
start = Time.now
|
||||||
begin
|
# Nanoc3::CLI::Base.new.run(["co"])
|
||||||
site.compiler.run
|
site = Nanoc3::Site.new('.')
|
||||||
puts ">>> Done in #{((Time.now - start)*10000).round.to_f / 10}ms <<<"
|
site.load_data
|
||||||
`growlnotify -m "Compilation Complete" --image misc/success-icon.png; exit 0`
|
begin
|
||||||
rescue Exception => e
|
site.compiler.run
|
||||||
puts ">>> ERROR: #{e.message} <<<"
|
puts ">>> Done in #{((Time.now - start)*10000).round.to_f / 10}ms <<<"
|
||||||
puts e.backtrace.join("\n")
|
`growlnotify -m "Compilation Complete" --image misc/success-icon.png; exit 0`
|
||||||
`growlnotify -m "Compilation Error!" --image misc/error-icon.png; exit 0`
|
rescue Exception => e
|
||||||
|
puts ">>> ERROR: #{e.message} <<<"
|
||||||
|
puts e.backtrace.join("\n")
|
||||||
|
`growlnotify -m "Compilation Error!" --image misc/error-icon.png; exit 0`
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
rebuild_site.call(nil,nil)
|
rebuild_site.call(nil,nil)
|
||||||
|
Loading…
Reference in New Issue
Block a user