diff options
Diffstat (limited to 'index.rb')
-rwxr-xr-x | index.rb | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,5 +1,6 @@ #!/usr/bin/env ruby # -*- coding: utf-8 -*- +require 'rdiscount' require 'erb' @title = "Web log entries" @@ -8,13 +9,13 @@ license = "CC BY-SA-3.0" license_url = 'https://creativecommons.org/licenses/by-sa/3.0/' @license="<a href=\"#{license_url}\">#{license}</a>" -@content = "<h1>#{@title}</h1>\n<ul>\n" +markdown = "# #{@title}\n\n" for filename in ARGV do title = File.read(filename).split("\n",2).first slug = filename.sub(/^public\//,'').sub(/\.md$/,'') - @content += "<li><tt><a href='./#{slug}.html'>#{slug}</a></tt> — #{title}</a></li>\n" + markdown += " * [`#{slug}`](./#{slug}.html) — #{title}\n" end -@content += "</ul>\n" +@content = RDiscount.new(markdown).to_html template = 'template.erb' erb = ERB.new(File.read(template)); |