diff --git a/content/style.css b/content/style.css index 8eacec1..cea6425 100644 --- a/content/style.css +++ b/content/style.css @@ -111,15 +111,6 @@ ul { padding-left: 1em; } -/* colors for techne states */ -span.techne_done { - color: green; -} - -span.techne_rough { - color: red; -} - em { color: #562D6F; font-style: italic; diff --git a/layouts/category.erb b/layouts/category.erb index 40dc7c9..5857080 100644 --- a/layouts/category.erb +++ b/layouts/category.erb @@ -30,5 +30,3 @@ end %>
<% end %> - - diff --git a/lib/default.rb b/lib/default.rb index 71d34dd..b7e4a75 100644 --- a/lib/default.rb +++ b/lib/default.rb @@ -21,80 +21,7 @@ def category name render "category", :category => name end -def techne status - case status - when :rough - "needs revisiting" - when :incomplete - "work in progress" - when :done - "finished" - else - status.to_s - end -end - -def episteme_cat status - s = case status - when :broken - "partly believed" - when :discredited - "not believed" - else - status.to_s - end - "[#{s}][Epistemic State]{:.episteme}" -end - # only articles that actually get printed def printed_items @items.select { |i| not i[:is_hidden] and not i.binary? } end - -# build rss feed -def rss_feed - require "rss/maker" - version = "2.0" - - # find changelog - log = @items.find{|i| i.identifier.match %r{/changelog/}} - - content = RSS::Maker.make(version) do |rss| - rss.channel.title = "Lies and Wonderland" - rss.channel.link = "http://muflax.com" - rss.channel.author = "mail@muflax.com" - rss.channel.description = "Lies and Wonderland" - rss.channel.date = log.mtime - rss.items.do_sort = true # sort items by date - - changes(log).each do |change| - i = rss.items.new_item - i.title = "muflax hath written unto you..." - i.link = "http://muflax.com/changelog/" - i.date = Time.parse(change[:date]) - i.description = change[:description] - end - end - - content -end - -# return changes based on changelog -def changes log - require 'nokogiri' - - changes = [] - - # parse log - html_log = Nokogiri::HTML(log.compiled_content) - html_log.css("ul#changelog").each do |ul| - ul.css("li").each do |li| - change = {} - change[:description] = li.children.to_s.strip - change[:date] = li.content[%r{\d{4}/\d{2}/\d{2}}] - changes << change - end - end - - changes -end diff --git a/lib/episteme.rb b/lib/episteme.rb new file mode 100644 index 0000000..9ce2bed --- /dev/null +++ b/lib/episteme.rb @@ -0,0 +1,26 @@ +# Helper functions for epistemic states. + +def techne status + case status + when :rough + "needs revisiting" + when :incomplete + "work in progress" + when :done + "finished" + else + status.to_s + end +end + +def episteme_cat status + s = case status + when :broken + "partly believed" + when :discredited + "not believed" + else + status.to_s + end + "[#{s}][Epistemic State]{:.episteme}" +end diff --git a/lib/rss.rb b/lib/rss.rb new file mode 100644 index 0000000..52b941e --- /dev/null +++ b/lib/rss.rb @@ -0,0 +1,47 @@ +# build rss feed +def rss_feed + require "rss/maker" + version = "2.0" + + # find changelog + log = @items.find{|i| i.identifier.match %r{/changelog/}} + + content = RSS::Maker.make(version) do |rss| + rss.channel.title = "Lies and Wonderland" + rss.channel.link = "http://muflax.com" + rss.channel.author = "mail@muflax.com" + rss.channel.description = "Lies and Wonderland" + rss.channel.date = log.mtime + rss.items.do_sort = true # sort items by date + + changes(log).each do |change| + i = rss.items.new_item + i.title = "muflax hath written unto you..." + i.link = "http://muflax.com/changelog/" + i.date = Time.parse(change[:date]) + i.description = change[:description] + end + end + + content +end + +# return changes based on changelog +def changes log + require 'nokogiri' + + changes = [] + + # parse log + html_log = Nokogiri::HTML(log.compiled_content) + html_log.css("ul#changelog").each do |ul| + ul.css("li").each do |li| + change = {} + change[:description] = li.children.to_s.strip + change[:date] = li.content[%r{\d{4}/\d{2}/\d{2}}] + changes << change + end + end + + changes +end