]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
* Add typographyattributes configuration setting to typography plugin.
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Tue, 5 Jun 2007 19:04:15 +0000 (19:04 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Tue, 5 Jun 2007 19:04:15 +0000 (19:04 +0000)
IkiWiki/Plugin/typography.pm
debian/changelog
doc/plugins/typography.mdwn
doc/todo/typography_plugin_configuration.mdwn

index 3b66ab0d087e871e8152992552ade197610c8039..5073d51d31a79858bfe68c3809a92f7c09a03ee0 100644 (file)
@@ -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
index 9c558b33ee0b78b0feede54f2c55893cbb04dd05..37b7edf79b957ad15ad2dc60fcd622f437624388 100644 (file)
@@ -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
 
index 2e65393a78d2509b2421c9a334705da63ea7ad97..b03c2a0866cab393cdf37386f45ecdfdea303bb7 100644 (file)
@@ -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.
index d920676e235499386d9bbf89aa1aeb7c27111e4b..91ac4ba857625b75bfc383109190e9afe676b039 100644 (file)
@@ -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]]