1 Star 0 Fork 0

Li/documentation

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Rakefile 822 Bytes
一键复制 编辑 原始数据 按行查看 历史
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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/expli/documentation.git
git@gitee.com:expli/documentation.git
expli
documentation
documentation
master

搜索帮助