summaryrefslogtreecommitdiff
path: root/rake_tasks/documentation.rake
blob: d555022cfae15213e8772502d722ba0ba29dc995 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
begin
  if RUBY_VERSION >= '1.8.7'
    gem 'rdoc' if defined? gem
    require 'rdoc/task'
  else
    require 'rake/rdoctask'
  end
rescue LoadError
  warn 'Please gem install rdoc.'
end

desc 'Generate documentation for CodeRay'
Rake::RDocTask.new :doc do |rd|
  rd.main = 'lib/README'
  rd.title = 'CodeRay Documentation'
  
  rd.options << '--line-numbers' << '--tab-width' << '2'
  # rd.options << '--fmt' << ENV.fetch('format', 'html_coderay')
  # require 'pathname'
  # template = File.join ROOT, 'rake_helpers', 'coderay_rdoc_template.rb'
  # rd.template = Pathname.new(template).expand_path.to_s
  
  rd.main = 'README_INDEX.rdoc'
  rd.rdoc_files.add 'README_INDEX.rdoc'
  rd.rdoc_files.add Dir['lib']
  rd.rdoc_dir = 'doc'
end if defined? Rake::RDocTask

desc 'Copy the documentation over to the CodeRay website'
task :copy_doc do
  cp_r 'doc/.', '../../rails/coderay/public/doc'
end