summaryrefslogtreecommitdiff
path: root/index.rb
blob: 9511c287a256649d1665dc087c54b88713eb20cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
load 'pandoc.rb'
require 'erb'

markdown = "Web log entries\n=====\n\n"
for filename in ARGV do
	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
puts markdown