require "write_down/version" require "minidown" require "mustache" require "nokogiri" require "write_down/article" require "write_down/converter" require "write_down/template" require "write_down/series" require "write_down/site" require "write_down/page" module WriteDown $site = Site.new #just a demo def self.hello "hello! I am write down! Enjoy!" end def self.build options puts "generating by theme #{options[:theme]} ........" #复制 html 模板到目标目录 FileUtils.cp_r File.expand_path("../template/#{options[:theme]}", File.dirname(__FILE__)) + '/.', options[:dist] articles = Article.build options[:source] Template.render options[:dist], articles end #定义一套步骤 def process # 检查 # 初始化结构 # 渲染+填充 # 结束 end end