From c7140ad90b0db2078e70b9cd3f08e1d176125191 Mon Sep 17 00:00:00 2001 From: joey Date: Thu, 21 Sep 2006 20:28:40 +0000 Subject: [PATCH] * Add typography (SmartyPants) plugin by Recai. --- IkiWiki/Plugin/typography.pm | 20 ++++++++++++++++++++ debian/changelog | 3 ++- doc/plugins/typography.mdwn | 7 +++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 IkiWiki/Plugin/typography.pm create mode 100644 doc/plugins/typography.mdwn diff --git a/IkiWiki/Plugin/typography.pm b/IkiWiki/Plugin/typography.pm new file mode 100644 index 000000000..d613f873b --- /dev/null +++ b/IkiWiki/Plugin/typography.pm @@ -0,0 +1,20 @@ +#!/usr/bin/perl + +package IkiWiki::Plugin::typography; + +use warnings; +use strict; +use IkiWiki; + +sub import { #{{{ + IkiWiki::hook(type => "sanitize", id => "typography", call => \&sanitize); +} # }}} + +sub sanitize (@) { #{{{ + my %params=@_; + + eval q{use Text::Typography}; + return Text::Typography::typography($params{content}); +} # }}} + +1 diff --git a/debian/changelog b/debian/changelog index da85371b7..c2a80fa24 100644 --- a/debian/changelog +++ b/debian/changelog @@ -52,8 +52,9 @@ ikiwiki (1.27) UNRELEASED; urgency=low whitespace-sensative situations. Closes: #387073 * Patch from James Westby to make the location of the estseek.cgi script configurable. + * Add typography (SmartyPants) plugin by Recai. - -- Joey Hess Mon, 18 Sep 2006 16:43:10 -0400 + -- Joey Hess Thu, 21 Sep 2006 16:27:44 -0400 ikiwiki (1.26) unstable; urgency=low diff --git a/doc/plugins/typography.mdwn b/doc/plugins/typography.mdwn new file mode 100644 index 000000000..c11da94ec --- /dev/null +++ b/doc/plugins/typography.mdwn @@ -0,0 +1,7 @@ +[[template id=plugin name=typography included=1 author="[[Roktas]]"]] +[[tag type/format]] + +This plugin, also known as +[SmartyPants](http://daringfireball.net/projects/smartypants/), translates +plain ASCII punctuation characters into ``smart'' typographic punctuation HTML +entities. To use it, you need to have the `Text::Typography` module installed. -- 2.26.2