使用纯 Ruby 代码来生成 HTML 页面 2014/11/23 15733 require 'rubygems' require 'markaby' m = Markaby::Builder.new items = ['Bread', 'Butter', 'Tea', 'Coffee'] m.html do body do h1 'My Shopping List' ol do items.each do |item| li item end end end end puts m