Commit 7283136d authored by Wandenberg's avatar Wandenberg

fix docs preview

parent ce1690fe
...@@ -55,6 +55,7 @@ begin ...@@ -55,6 +55,7 @@ begin
listener.change(&copy_inner_js) listener.change(&copy_inner_js)
listener.start(false) listener.start(false)
end end
rescue LoadError rescue LoadError
desc "Run javascript tests" desc "Run javascript tests"
task :jasmine do task :jasmine do
...@@ -84,8 +85,8 @@ begin ...@@ -84,8 +85,8 @@ begin
base_path = File.expand_path('pushstream/docs/preview', Dir.tmpdir) base_path = File.expand_path('pushstream/docs/preview', Dir.tmpdir)
FileUtils.mkdir_p("#{base_path}/css") FileUtils.mkdir_p("#{base_path}/css")
download_file("https://a248.e.akamai.net/assets.github.com/assets/github-00f65189aa131d891441bde58bf26d999ab4d29c.css", "#{base_path}/css/github.css") unless File.exists?("#{base_path}/css/github.css") download_file("https://github.global.ssl.fastly.net/assets/github-f226abc7983f8566b17d24236adae64ba647ffea.css", "#{base_path}/css/github.css") unless File.exists?("#{base_path}/css/github.css")
download_file("https://a248.e.akamai.net/assets.github.com/assets/github2-90ff47ca514fab587fdf9f40626c56af77a8fa6b.css", "#{base_path}/css/github2.css") unless File.exists?("#{base_path}/css/github2.css") download_file("https://github.global.ssl.fastly.net/assets/github2-6edea06c20f02c9c2ae32842c7455d50c08c3f69.css", "#{base_path}/css/github2.css") unless File.exists?("#{base_path}/css/github2.css")
end end
desc "Generates docs files to preview." desc "Generates docs files to preview."
...@@ -98,7 +99,7 @@ begin ...@@ -98,7 +99,7 @@ begin
filename = File.basename(file) filename = File.basename(file)
content = GitHub::Markup.render(file, File.read(file)) content = GitHub::Markup.render(file, File.read(file))
rendered = template.result(binding) rendered = template.result(binding)
output = file.gsub(project_dir, File.expand_path('pushstream/docs/preview', Dir.tmpdir)).gsub(".textile", ".html") output = file.gsub(project_dir, File.expand_path('pushstream/docs/preview', Dir.tmpdir))
output_dir = File.dirname(output) output_dir = File.dirname(output)
FileUtils.mkdir_p(output_dir) FileUtils.mkdir_p(output_dir)
File.open(output, 'w') {|f| f.write(rendered) } File.open(output, 'w') {|f| f.write(rendered) }
......
...@@ -4,10 +4,9 @@ ...@@ -4,10 +4,9 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8"> <meta charset="utf-8">
<title><%= filename %> - Preview to GitHub</title> <title><%= filename %> - Preview to GitHub</title>
<base href="file://<%= base_path %>/" />
<link href="css/github.css" media="screen" rel="stylesheet" type="text/css" /> <link href="file://<%= base_path %>/css/github.css" media="screen" rel="stylesheet" type="text/css" />
<link href="css/github2.css" media="screen" rel="stylesheet" type="text/css" /> <link href="file://<%= base_path %>/css/github2.css" media="screen" rel="stylesheet" type="text/css" />
<style> <style>
#preview-content .markdown-body, #preview-content .plain { #preview-content .markdown-body, #preview-content .plain {
background-color: #FFFFFF; background-color: #FFFFFF;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment