* Add typographyattributes configuration setting to typography plugin.
parent
13d7ea675a
commit
435e06bce1
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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]]
|
||||
|
|
Loading…
Reference in New Issue