support for poem tags

master
muflax 2012-09-09 18:30:19 +02:00
parent 909c545c58
commit 4ab80e9fca
2 changed files with 11 additions and 0 deletions

View File

@ -5,6 +5,7 @@ techne: :done
episteme: :fiction
---
<% poem do %>
After the Singularity
I will wear new bodies,
fitting shells for my mind,
@ -102,3 +103,4 @@ chasing the perfect phrase.
After the Singularity
I will no longer
need justifications.
<% end %>

View File

@ -6,16 +6,25 @@ def meta &block
end
end
# wrap in div tags
def div_wrap tag, text
"<div class='#{tag}' markdown='1'>#{text}</div>"
end
# don't parse this when counting words
def skip &block
annotate block do |c|
c unless @item_rep.name == :wordcount
end
end
# replace end-of-line with " " used by markdown
def poem &block
annotate block do |c|
c.split("\n").join(" \n")
end
end
def annotate content, &filter
# get erbout so far
erbout = eval('_erbout', content.binding)