Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 34 lines (29 sloc) 0.83 kB
4663b0b @runpaint Created Rakefile for generating PDF.
authored
1
2 file 'output/all.html' => FileList['text/**/*.html'] do |t|
3 File.open(t.name,'w') do |out|
4 t.prerequisites.sort.each do |source|
5 out.puts File.open(source).read
6 end
7 end
8 end
9
10 file 'output/vim-recipes.pdf' => ['output/all.html'] do |t|
11 system("prince #{t.prerequisites.first} #{t.name}")
12 end
13
14 task :pdf => ['output/vim-recipes.pdf'] do
15 end
5871e9e @runpaint Add :ilinks task to display broken internal links.
authored
16
17 task :ilinks => ['output/all.html'] do |t|
18 require 'hpricot'
19 target = {}
20 source = {}
21 FileList['text/**/*.html'].each do |file|
22 doc = Hpricot(File.open(file, 'r'))
23 doc.search("a[@href*='#']").each do |a|
24 source[a['href'][/[^#]+/]] = file
25 end
26 doc.search("*[@id]").each do |e|
27 target[e['id']] = 1
28 end
29 end
30 source.keys.each do |s|
31 $stderr.puts "Link #{s} from #{source[s]} is broken" unless target.key? s
32 end
33 end
Something went wrong with that request. Please try again.