-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmake-demos
More file actions
executable file
·40 lines (33 loc) · 1022 Bytes
/
make-demos
File metadata and controls
executable file
·40 lines (33 loc) · 1022 Bytes
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
#!/usr/bin/env ruby
demos = [
"autumn",
"colorful",
"fruity",
"monokai",
"native",
"perldoc",
"solarized-dark",
"solarized-light",
"trac",
"vim"
]
demo_single_template = File.read('templates/demo-single.html')
demo_list_html = File.read('templates/demo-list.html')
demo_list = File.new("../index.html", "w")
demo_list_find = '<!-- DEMO_LIST -->'
demo_list_replace = ''
demos.each do |demo|
out = File.new("../demos/#{demo}-converted.html", "w")
out.puts "<link rel=\"stylesheet\" href=\"../#{demo}.css\">"
out.puts demo_single_template
out.close
out = File.new("../demos/#{demo}-original.html", "w")
out.puts "<link rel=\"stylesheet\" href=\"../original-stylesheets/#{demo}.css\">"
out.puts demo_single_template
out.close
demo_list_replace += "<h3>#{demo}.css</h3>"
demo_list_replace += "<iframe src=\"demos/#{demo}-converted.html\" title=\"#{demo}.css demo\"></iframe>"
end
demo_list_html.sub! demo_list_find, demo_list_replace
demo_list.puts demo_list_html
demo_list.close