summaryrefslogtreecommitdiff
path: root/index.rb
diff options
context:
space:
mode:
Diffstat (limited to 'index.rb')
-rwxr-xr-xindex.rb20
1 files changed, 5 insertions, 15 deletions
diff --git a/index.rb b/index.rb
index f3ef5b0..9511c28 100755
--- a/index.rb
+++ b/index.rb
@@ -1,23 +1,13 @@
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
-require 'rdiscount'
+load 'pandoc.rb'
require 'erb'
-@title = "Web log entries"
-@copyright = "Luke Shumaker"
-license = "CC BY-SA-3.0"
-license_url = 'https://creativecommons.org/licenses/by-sa/3.0/'
-@license="<a href=\"#{license_url}\">#{license}</a>"
-
-markdown = "# #{@title}\n\n"
+markdown = "Web log entries\n=====\n\n"
for filename in ARGV do
- title = File.read(filename).split("\n",2).first
+ input = File.read(filename)
+ title = Pandoc::load('markdown',input)["title"] || input.split("\n",2).first
slug = filename.sub(/^public\//,'').sub(/\.md$/,'')
markdown += " * [`#{slug}`](./#{slug}.html) — #{title}\n"
end
-@content = RDiscount.new(markdown).to_html
-
-template = 'template.erb'
-erb = ERB.new(File.read(template));
-erb.filename = template
-erb.run()
+puts markdown