# encoding: utf-8
# Copyright (C) 2016 Ian Kelling
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see
All JavaScript has LibreJS support.
" DAY = 60*60*24 DN = 'iankelling' FQDN = DN + '.org' DURL = 'https://' + FQDN DESCRIPTION = "Ian Kelling's personal site and blog on software" DATE_LEN = 'YYYY-MM-DD'.length NOW = Time.now.to_f WAIT_DATE = NOW - 60*60*24*1 def db_init SQLite3::Database.new('../proposed-comments/comments.sqlite') end # from the redcarpet readme, then a bunch of googling to figure # out what to do on exception. class HTMLwithPygments < Redcarpet::Render::HTML def block_code(code, language) begin Pygments.highlight(code, lexer: language) rescue MentosError # when language detection fails Pygments.highlight(code, lexer: 'text') end end end def fwrite(output_path, string) output_path = File.join('./', output_path) FileUtils.mkdir_p(File.dirname(output_path)) File.write(output_path, string) end def fskel(rel_path, title, content, o={}) head = <#{Time.at(date).strftime("%b %-d '%y")}
EOF end def techpost(file) b = File.basename(file,'.md') # double dash for one dash, single dash for space title = b.gsub(/--|-/, '--' => '-', '-' => ' ') md = File.read(file) page_html = "