代码拉取完成,页面将自动刷新
require "rubygems"
require "rake"
require "redcarpet"
require "html/proofer"
BUILD_DIR = "./_build"
task :build => [:clean]
task :test => [:build]
task :default => [:test]
desc "Generate the build"
task :build do
# copy files
files = Dir.glob("*")
mkdir BUILD_DIR
cp_r files, BUILD_DIR
# render markdown
redcarpet = Redcarpet::Markdown.new Redcarpet::Render::HTML.new({}), {}
md_files = Dir.glob File.join(BUILD_DIR, "**", "*.md")
md_files.each do |md|
html = redcarpet.render File.open(md).read
File.open(md, File::WRONLY).write html
end
puts "Rendered #{md_files.length} markdown files."
end
desc "Remove the build"
task :clean do
rm_rf BUILD_DIR
end
desc "Test the build"
task :test do
HTML::Proofer.new(BUILD_DIR, { :ext => ".md", :directory_index_file => "README.md" }).run
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。