# coding: utf-8
load 'pandoc.rb'
require 'erb'
require 'date'
$license_urls = {
"CC BY-SA-3.0" => 'https://creativecommons.org/licenses/by-sa/3.0/',
'WTFPL-2' => "http://www.wtfpl.net/txt/copying/",
}
$person_uris = {
"Luke Shumaker" => "https://lukeshu.com/",
"Andrew Murrell" => "https://andrewdm.me/",
}
$person_emails = {
"Luke Shumaker" => "lukeshu@parabola.nu",
"Andrew Murrell" => "ImFromNASA@gmail.com",
}
class Person
def initialize(name)
@name = name
end
def name
@name
end
def uri
$person_uris[@name]
end
def email
$person_emails[@name]
end
def html
if not email.nil?
return "#{name}"
elsif not uri.nil?
return "#{name}"
else
return @name
end
end
def atom
ret = ""
ret += "
The content of this page is Copyright © #{date.year unless date.nil?} #{author.html}.
\n" + "This page is licensed under the #{license.html} license.
" end def src @src ||= infile.sub(/^(src|out)\//, '/') end def breadcrumbs if @breadcrumbs.nil? bc = [] url = src.sub(/\.[^\/.]*$/, '.html').sub(/\/index[.]html$/, '') url = '/' if url == '' while url != "/" bc.unshift("#{File.basename(url, File.extname(url))}") url = File.dirname(url) end bc.unshift("Andrew D. Murrell") @breadcrumbs = bc.join(' » ') end @breadcrumbs end end def html_escape(html) html .gsub('&', '&') .gsub('>', '>') .gsub('<', '<') end