-
Notifications
You must be signed in to change notification settings - Fork 75
/
Rakefile
149 lines (132 loc) · 3.55 KB
/
Rakefile
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
require "rake"
namespace :rst do
desc "Generate reStructuredText file"
task :generate do
puts "Generating reStructuredText file from Markdown"
system("pandoc -s -w rst resume.markdown -o resume.rst")
puts "Done"
end
end
namespace :html do
desc "Compile stylesheet"
task :styles do
puts "Compiling CSS file"
system("compass compile")
end
desc "Generate standalone HTML file"
task :generate => [:styles] do
puts "Generating standalone HTML file from Markdown"
system("pandoc -s -S resume.markdown -o resume.html -t html5 --self-contained --section-divs --template=resume-template.html -T \"Stephen Tudor's Resume\" -c css/main.css")
system("cp resume.html index.html")
puts "Done"
end
end
namespace :tex do
desc "Generate LaTeX file"
task :generate do
puts "Generating LaTeX file from Markdown"
system("pandoc -s -w context resume.markdown -o resume.tex")
puts "Done"
end
end
namespace :pdf do
desc "Generate PDF file"
task :generate => ["tex:generate"] do
puts "Generating PDF file from LaTeX"
system("texexec --pdf resume.tex")
puts "Done"
end
end
namespace :rtf do
desc "Generate RTF file"
task :generate do
puts "Generating RTF file from Markdown"
system("pandoc -s -S resume.markdown -o resume.rtf")
puts "Done"
end
end
namespace :word do
desc "Generate docx file"
task :generate do
puts "Generating docx file from Markdown"
system("pandoc -s -S resume.markdown -o resume.docx --reference-docx=resume-reference.docx")
puts "Done"
end
end
namespace :odt do
desc "Generate ODT file"
task :generate do
puts "Generating ODT file from Markdown"
system("pandoc -s -S resume.markdown -o resume.odt")
puts "Done"
end
end
namespace :epub do
desc "Generate EPUB file"
task :generate do
puts "Generating EPUB file from Markdown"
system("pandoc -s -S resume.markdown -o resume.epub")
puts "Done"
end
end
namespace :asciidoc do
desc "Generate AsciiDoc file"
task :generate do
puts "Generating AsciiDoc file from Markdown"
system("pandoc -s -S resume.markdown -t asciidoc -o resume.txt")
puts "Done"
end
end
namespace :docbook do
desc "Generate DocBook file"
task :generate do
puts "Generating DocBook file from Markdown"
system("pandoc -s -S -w docbook resume.markdown -o resume.db")
puts "Done"
end
end
desc "Copy resume to README"
task :readme do
puts "Copying README"
system("cp resume.markdown README.markdown")
puts "Done"
end
desc "Generate all formats"
task :all => [
"rst:generate",
"html:generate",
"pdf:generate",
"rtf:generate",
"word:generate",
"odt:generate",
"epub:generate",
"asciidoc:generate",
"docbook:generate",
"readme"
]
desc "Transfer resume files to web"
task :web do
puts "Transferring files to web..."
path = "smt@s17r.com:s17r.com/public"
system("scp resume.* index.html #{path}/resume")
system("scp index.html #{path}")
puts "Done"
end
desc "Commit change"
task :ci do
puts "Done"
system("git checkout master")
system("git add resume.db resume.docx resume.epub resume.html resume.markdown resume.odt resume.pdf resume.rst resume.rtf resume.tex resume.txt README.markdown index.html")
system("git commit -m 'Update resume files'")
puts "Done"
end
desc "Push to GitHub"
task :push => [:ci] do
system("git checkout gh-pages")
system("git checkout -f master index.html")
system("git add index.html")
system("git commit -m 'Update resume on GitHub Pages'")
system("git push -f")
system("git checkout master")
end
task :default => ["html:generate"]