summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/textile.pm
blob: 5de71bf6eb11aa682dde75eaac98970b4174c9f9 (plain)
  1. #!/usr/bin/perl
  2. # By mazirian; GPL license
  3. # Textile markup
  4. package IkiWiki::Plugin::textile;
  5. use warnings;
  6. use strict;
  7. use IkiWiki 2.00;
  8. sub import { #{{{
  9. hook(type => "htmlize", id => "txtl", call => \&htmlize);
  10. } # }}}
  11. sub htmlize (@) { #{{{
  12. my %params=@_;
  13. my $content = $params{content};
  14. eval q{use Text::Textile};
  15. return $content if $@;
  16. return Text::Textile::textile($content);
  17. } # }}}
  18. 1