22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/buttless.rb', line 22
def generate_html(with_base=false)
Dir.chdir(@home_dir)
Dir.chdir('api-doc')
@root_url = with_base ? "file://localhost#{Dir.pwd}/" : "./"
reload_data()
doc = Tilt.new("index.md.erb").render(self, :db=>@db, :helper=>Helper.new, :config=>@config)
md = Redcarpet::Markdown.new(Redcarpet::Render::HTML.new(render_options={}), extensions={:tables=>true})
@content = md.render(doc)
@html = ERB.new(File.open('template.html.erb','r').read()).result(binding())
@html = @html.gsub(/root_url/,@root_url)
end
|