Abandon project from the old CTHN era.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

27 lines
705 B

9 years ago
desc "Convert the old wiki into Markdown"
task :convert do
sh "scripts/importer.rb"
end
desc "Generate HTML stuff from markdown"
task :generate do
require "kramdown"
require "fileutils"
import_folder = "import_results"
target_folder = "public_html"
#Dir.mkdir(target_folder)
FileUtils.rm_rf(target_folder) if Dir.exists?(target_folder)
Dir.mkdir(target_folder)
FileUtils.cp_r(File.join(import_folder, "images"), target_folder)
Dir.glob("#{import_folder}/*.mkd").each do |file|
content = Kramdown::Document.new(File.new(file, "r").read).to_html
File.open(File.join(target_folder, File.basename(file)[0..-4] + "html"), "w") do |fh|
fh.write(content)
end
end
9 years ago
end