Permalink
Browse files

Rakefile: Remove :ilinks task.

We'll check for broken links when we fix the <a href="#...">s instead.
  • Loading branch information...
1 parent 82187d0 commit 83f4642db89c73f32588f6105da6c9b77c04b755 @runpaint committed May 13, 2009
Showing with 3 additions and 21 deletions.
  1. +3 −21 Rakefile
View
@@ -18,7 +18,7 @@ task :images => IMAGES do |t|
end
desc "Combine source HTML into single HTML file"
-task OUTPUT_HTML => [:output, :images, :ilinks]
+task OUTPUT_HTML => [:output, :images]
file OUTPUT_HTML => SOURCE_HTML do |t|
File.open(t.name,'w') do |out|
SOURCE_HTML.sort.each do |source|
@@ -122,30 +122,12 @@ task :html => SOURCE_HTML do |t|
File.open(path,'w') {|file| file.puts page}
end
end
- page = Erubis::Eruby.new(File.open('templates/toc.html').read).result({:toc => toc.dup})
+ page = Erubis::Eruby.new(File.open('templates/toc.html').read).
+ result({:toc => toc.dup.reject{|e| e[:type] == :subsection}})
mkdir_p 'output/toc'
File.open('output/toc/index.html','w') {|file| file.puts page}
end
-desc "Check for broken internal links"
-task :ilinks do |t|
- require 'hpricot'
- target = {}
- source = {}
- SOURCE_HTML.each do |file|
- doc = Hpricot(File.open(file, 'r'))
- doc.search("a[@href*='#']").each do |a|
- source[a['href'][/[^#]+/]] = file
- end
- doc.search("*[@id]").each do |e|
- target[e['id']] = 1
- end
- end
- source.keys.each do |s|
- $stderr.puts "Link #{s} from #{source[s]} is broken" unless target.key? s
- end
-end
-
directory 'output/css'
desc "Generate the website"
task :www => ['output/vim-recipes.pdf',:html, 'output/css'] do

0 comments on commit 83f4642

Please sign in to comment.