aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-06-05 19:04:15 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-06-05 19:04:15 +0000
commit435e06bce1fb8efe209ca0a7edf2c9f4d40db478 (patch)
treeae299bbed0b18ea1ff1fa50f321048a4b6e77f08
parent13d7ea675a7f672b4c8bac5b77f0bc5e9b7cf797 (diff)
downloadikiwiki-435e06bce1fb8efe209ca0a7edf2c9f4d40db478.tar
ikiwiki-435e06bce1fb8efe209ca0a7edf2c9f4d40db478.tar.gz
* Add typographyattributes configuration setting to typography plugin.
-rw-r--r--IkiWiki/Plugin/typography.pm11
-rw-r--r--debian/changelog3
-rw-r--r--doc/plugins/typography.mdwn4
-rw-r--r--doc/todo/typography_plugin_configuration.mdwn2
4 files changed, 18 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/typography.pm b/IkiWiki/Plugin/typography.pm
index 3b66ab0d0..5073d51d3 100644
--- a/IkiWiki/Plugin/typography.pm
+++ b/IkiWiki/Plugin/typography.pm
@@ -7,16 +7,25 @@ use strict;
use IkiWiki 2.00;
sub import { #{{{
+ hook(type => "getopt", id => "typography", call => \&getopt);
IkiWiki::hook(type => "sanitize", id => "typography", call => \&sanitize);
} # }}}
+sub getopt () { #{{{
+ eval q{use Getopt::Long};
+ error($@) if $@;
+ Getopt::Long::Configure('pass_through');
+ GetOptions("typographyattributes=s" => \$config{typographyattributes});
+} #}}}
+
sub sanitize (@) { #{{{
my %params=@_;
eval q{use Text::Typography};
return $params{content} if $@;
- return Text::Typography::typography($params{content});
+ my $attributes=defined $config{typographyattributes} ? $config{typographyattributes} : '3';
+ return Text::Typography::typography($params{content}, $attributes);
} # }}}
1
diff --git a/debian/changelog b/debian/changelog
index 9c558b33e..37b7edf79 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -35,8 +35,9 @@ ikiwiki (2.2) UNRELEASED; urgency=low
* Fix wrapper generator and untaint code's handling of strings contining
newlines.
* Make the url absolution code for feeds significantly more robust.
+ * Add typographyattributes configuration setting to typography plugin.
- -- Joey Hess <joeyh@debian.org> Sun, 03 Jun 2007 13:10:08 -0400
+ -- Joey Hess <joeyh@debian.org> Tue, 05 Jun 2007 15:03:48 -0400
ikiwiki (2.1) unstable; urgency=low
diff --git a/doc/plugins/typography.mdwn b/doc/plugins/typography.mdwn
index 2e65393a7..b03c2a086 100644
--- a/doc/plugins/typography.mdwn
+++ b/doc/plugins/typography.mdwn
@@ -6,3 +6,7 @@ This plugin, also known as
plain ASCII punctuation characters into ``smart'' typographic punctuation HTML
entities. To use it, you need to have the [[cpan Text::Typography]] module
installed.
+
+This plugin has a configuration option. To change the attributes,
+set `--typographyattributes=whatever`. See the documentation for
+[[cpan Text::Typography]] for available attributes.
diff --git a/doc/todo/typography_plugin_configuration.mdwn b/doc/todo/typography_plugin_configuration.mdwn
index d920676e2..91ac4ba85 100644
--- a/doc/todo/typography_plugin_configuration.mdwn
+++ b/doc/todo/typography_plugin_configuration.mdwn
@@ -2,3 +2,5 @@ The [[typography_plugin|plugins/typography]] could support configuration of
which translations to make. [[cpan Text::Typography]] supports fine-grained
control of which translations to make, so [[plugins/typography]] just needs to
expose this somehow. --[[JoshTriplett]]
+
+[[done]] --[[Joey]]