summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/textile.pm
blob: ee8e88ed206bd6cabda1f7fb4c9d46cec84aa48b (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;
  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