From 7819f34a503bbe00c35c384119d0935735689dbc Mon Sep 17 00:00:00 2001 From: joey Date: Fri, 29 Dec 2006 05:18:39 +0000 Subject: [PATCH] * Add a textile format plugin contributed by mazirian. --- IkiWiki/Plugin/textile.pm | 24 ++++++++++++++++++++++++ debian/changelog | 3 ++- doc/features.mdwn | 3 ++- doc/plugins/contrib/textile.mdwn | 12 ------------ doc/plugins/textile.mdwn | 6 ++++++ 5 files changed, 34 insertions(+), 14 deletions(-) create mode 100644 IkiWiki/Plugin/textile.pm delete mode 100644 doc/plugins/contrib/textile.mdwn create mode 100644 doc/plugins/textile.mdwn diff --git a/IkiWiki/Plugin/textile.pm b/IkiWiki/Plugin/textile.pm new file mode 100644 index 000000000..ee8e88ed2 --- /dev/null +++ b/IkiWiki/Plugin/textile.pm @@ -0,0 +1,24 @@ +#!/usr/bin/perl +# By mazirian; GPL license +# Textile markup + +package IkiWiki::Plugin::textile; + +use warnings; +use strict; +use IkiWiki; + +sub import { #{{{ + hook(type => "htmlize", id => "txtl", call => \&htmlize); +} # }}} + +sub htmlize (@) { #{{{ + my %params=@_; + my $content = $params{content}; + + eval q{use Text::Textile}; + return $content if $@; + return Text::Textile::textile($content); +} # }}} + +1 diff --git a/debian/changelog b/debian/changelog index 50d970bb8..9d6b7a42a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,8 +19,9 @@ ikiwiki (1.37) UNRELEASED; urgency=low * Export gettext() from IkiWiki module. * Don't put discussion links on discussion pages. * Allow disabling of plugins included in goodstuff. + * Add a textile format plugin contributed by mazirian. - -- Joey Hess Thu, 28 Dec 2006 23:49:11 -0500 + -- Joey Hess Fri, 29 Dec 2006 00:17:58 -0500 ikiwiki (1.36) unstable; urgency=low diff --git a/doc/features.mdwn b/doc/features.mdwn index 05aeebfc9..966fea98f 100644 --- a/doc/features.mdwn +++ b/doc/features.mdwn @@ -39,7 +39,8 @@ provided by ikiwiki on top of regular markdown is the [[WikiLink]] and If you prefer to use some other markup language, ikiwiki allows others to easily be added by [[plugins]]. For example it also supports traditional [[plugins/WikiText]] formatted pages, pages written as pure -[[plugins/HTML]], or pages written in [[reStructuredText|plugins/rst]]. +[[plugins/HTML]], or pages written in [[reStructuredText|plugins/rst]] +or [[Textile|plugins/textile]]. ikiwiki also supports files of any other type, including plain text, images, etc. These are not converted to wiki pages, they are just copied diff --git a/doc/plugins/contrib/textile.mdwn b/doc/plugins/contrib/textile.mdwn deleted file mode 100644 index 953382b15..000000000 --- a/doc/plugins/contrib/textile.mdwn +++ /dev/null @@ -1,12 +0,0 @@ -[[template id=plugin name=syntax author="mazirian"]] -[[tag type/format]] -[[meta title="textile (third-party plugin)"]] - -Textile is a veratile markup language. So here's a trivial (in that it is a -direct adaptation of the wikitext plugin) plugin that will use the Textile -markup language to render .txtl files in your data directory. You must have -[[cpan Text::Textile]] installed for it to work. Naturally, it is released under -the terms of the GPL. - -Download: [textile.pm](http://mazirian.com/files/textile.pm) (December 28, -2006) diff --git a/doc/plugins/textile.mdwn b/doc/plugins/textile.mdwn new file mode 100644 index 000000000..6ffec41b9 --- /dev/null +++ b/doc/plugins/textile.mdwn @@ -0,0 +1,6 @@ +[[template id=plugin name=syntax author="mazirian"]] +[[tag type/format]] + +Textile is a veratile markup language. So here's a plugin that will use the +Textile markup language to render .txtl files in your data directory. +You must have [[cpan Text::Textile]] installed for it to work. -- 2.26.2