summaryrefslogtreecommitdiff
path: root/index.rb
diff options
context:
space:
mode:
Diffstat (limited to 'index.rb')
-rwxr-xr-xindex.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/index.rb b/index.rb
index 60aa54b..f3ef5b0 100755
--- a/index.rb
+++ b/index.rb
@@ -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));