Include_poem Octopress Plugin

I wrote a small plugin to enable me to easily include my poetry translations in Octopress posts, based on the include_code tag.

To install, copy include_poem.rb to your octopress/plugins directory.

It is currently optimized for the Octoflat theme and may not render properly in other themes.

An example:

1
{% include_poem title="Roses are Red" left=roses.txt %}

will render:

Roses are Red
1
Roses are red,
2
Violets are blue,
3
Sugar is sweet,
4
And so are you.

For rendering translations,

1
{% include_poem title="Roses are Red" left=roses.txt right=roses.txt %}

will render two poems side-by-side:

Roses are Red
1
Roses are red,
Roses are red,
2
Violets are blue,
Violets are blue,
3
Sugar is sweet,
Sugar is sweet,
4
And so are you.
And so are you.

The tag will process markdown in the files, and separate out footnotes. For example given a file that looks like:

1
2
3
4
Here is a line[^1]
And here is *another*.

[^1]: What a line looks like.

You will see something like this:

programming/Sample.txt
1
Here is a line1
2
And here is another.
  1. What a line looks like.

Comments