-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
39 lines (29 loc) · 1.05 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
require 'slim'
require 'tilt'
require 'redcarpet'
mkd_renderer_opts = {
with_toc_data: true
}
mkd_renderer = Redcarpet::Render::HTML.new(mkd_renderer_opts)
mkd_extensions = {
no_intra_emphasis: true,
lax_spacing: true,
highlight: true
}
Slim::Engine.set_default_options pretty: true
Slim::Embedded.set_default_options markdown: mkd_extensions
Tilt.register Tilt::RedcarpetTemplate::Redcarpet2, 'markdown', 'mkd', 'md'
Tilt.prefer Tilt::RedcarpetTemplate::Redcarpet2, 'markdown'
desc "Render the page"
task :render => ["gh-pages/index.html", 'gh-pages/css/main.css']
file "gh-pages/index.html" => ["resume.mkd", "layout.slim", __FILE__] do
layout = Tilt.new('layout.slim')
# template = Tilt.new('resume.mkd')
# Tilt won't let me pass the right options to redcarpet
mkd = Redcarpet::Markdown.new(mkd_renderer, mkd_extensions)
content = layout.render { mkd.render(File.read("resume.mkd")) }
File.open("gh-pages/index.html", "w") { |f| f.write(content) }
end
file "gh-pages/css/main.css" => "css/main.scss" do
`compass compile css/main.scss`
end