Created
July 13, 2012 17:31
-
-
Save ctyo/3106157 to your computer and use it in GitHub Desktop.
FreeStyleWiki上でMarkdown記法での記入を可能にするプラグイン
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################ | |
# | |
# FreeStyleWiki上でMarkdown記法での記入を可能にします。 | |
# | |
############################################################ | |
package plugin::markdown::Install; | |
use strict; | |
sub install { | |
my $wiki = shift; | |
$wiki->add_block_plugin( | |
"markdown", "plugin::markdown::Markdown", "HTML"); | |
} | |
1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################ | |
# | |
# <p>FreeStyleWiki上でMarkdown記法での記入を可能にします。</p> | |
# <pre> | |
# {{markdown | |
# something markdown text | |
# anything markdown text | |
# }} | |
# </pre> | |
# <p>なお利用するには <a href="http://search.cpan.org/~bobtfish/Text-Markdown-1.000031/lib/Text/Markdown.pm">Text::Markdown</a> が必要です。<br /> | |
# | |
# 2012.07.14 A.Tatsukawa [Website](http://ctyo.info)</p> | |
# | |
############################################################ | |
package plugin::markdown::Markdown; | |
use strict; | |
use Text::Markdown qw/markdown/; | |
#=========================================================== | |
# コンストラクタ | |
#=========================================================== | |
sub new { | |
my $class = shift; | |
my $self = {}; | |
return bless $self,$class; | |
} | |
#=========================================================== | |
# ブロック内を処理 | |
#=========================================================== | |
sub block { | |
my $self = shift; | |
my $wiki = shift; | |
my $wiki_source = shift; | |
return markdown($wiki_source); | |
} | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment