From 34fff64e7b56f4f8cd99430f9f927d2a5d1e3619 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 06:35:52 -0500 Subject: setup file ordering --- IkiWiki/Plugin/graphviz.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'IkiWiki/Plugin/graphviz.pm') diff --git a/IkiWiki/Plugin/graphviz.pm b/IkiWiki/Plugin/graphviz.pm index 32e994d6b..bec122076 100644 --- a/IkiWiki/Plugin/graphviz.pm +++ b/IkiWiki/Plugin/graphviz.pm @@ -18,6 +18,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } -- cgit v1.2.3 From ab575a4b6985d38969069757bb374aa8f1013019 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 4 May 2010 16:54:58 -0400 Subject: graphviz: Fix display of preexisting images in preview mode. --- IkiWiki/Plugin/graphviz.pm | 7 +------ debian/changelog | 1 + doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn | 8 ++++++++ 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'IkiWiki/Plugin/graphviz.pm') diff --git a/IkiWiki/Plugin/graphviz.pm b/IkiWiki/Plugin/graphviz.pm index bec122076..c91c92fec 100644 --- a/IkiWiki/Plugin/graphviz.pm +++ b/IkiWiki/Plugin/graphviz.pm @@ -79,12 +79,7 @@ sub render_graph (\%) { } } - if ($params{preview}) { - return "\n"; - } - else { - return "\n"; - } + return "\n"; } sub graph (@) { diff --git a/debian/changelog b/debian/changelog index 9fb9607a3..31deaf9aa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,7 @@ ikiwiki (3.20100502) UNRELEASED; urgency=low (COMMENTSLINK and DISCUSSIONLINK could be folded into this, but are kept separate for now to avoid breaking modified templates.) * websetup: Only display Setup button on admins' preferences page. + * graphviz: Fix display of preexisting images in preview mode. -- Joey Hess Sun, 02 May 2010 13:22:50 -0400 diff --git a/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn b/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn index 283a6ef08..c77bbeeaf 100644 --- a/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn +++ b/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn @@ -44,3 +44,11 @@ >>> case from the root of the site). The browsers appear to be trying to fetch >>> `/demo/diagrams/demo/diagrams/graph-c9fd2a197322feb417bdedbca5e99f5aa65b3f06.png` >>> (i.e., prepending the required relpath twice). -- [[Jon]] + +>>>> Yeah, that patch may have been right once, but it's wrong now; +>>>> preview mode uses `` to make urls work the same as they would +>>>> when viewing the html page. +>>>> +>>>> Perhaps this was not noticed for a while while because it only +>>>> shows up if previewing an *unchanged* graph on a page that has already +>>>> been built before. Fixed now. [[done]] --[[Joey]] -- cgit v1.2.3 From b2327cfae4ac7da1df7bbf848f575b553f74eafb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 9 Jun 2010 17:43:20 -0400 Subject: improve preview mode comments --- IkiWiki/Plugin/graphviz.pm | 3 ++- IkiWiki/Plugin/img.pm | 3 ++- IkiWiki/Plugin/sparkline.pm | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'IkiWiki/Plugin/graphviz.pm') diff --git a/IkiWiki/Plugin/graphviz.pm b/IkiWiki/Plugin/graphviz.pm index c91c92fec..dfd66a03e 100644 --- a/IkiWiki/Plugin/graphviz.pm +++ b/IkiWiki/Plugin/graphviz.pm @@ -71,7 +71,8 @@ sub render_graph (\%) { writefile($dest, $config{destdir}, $png, 1); } else { - # can't write the file, so embed it in a data uri + # in preview mode, embed the image in a data uri + # to avoid temp file clutter eval q{use MIME::Base64}; error($@) if $@; return "Resize(geometry => "${w}x${h}"); error sprintf(gettext("failed to resize: %s"), $r) if $r; - # don't actually write file in preview mode + # don't actually write resized file in preview mode; + # rely on width and height settings if (! $params{preview}) { my @blob = $im->ImageToBlob(); writefile($imglink, $config{destdir}, $blob[0], 1); diff --git a/IkiWiki/Plugin/sparkline.pm b/IkiWiki/Plugin/sparkline.pm index 42665ac63..1b1d04cba 100644 --- a/IkiWiki/Plugin/sparkline.pm +++ b/IkiWiki/Plugin/sparkline.pm @@ -158,7 +158,8 @@ sub preprocess (@) { writefile($fn, $config{destdir}, $png, 1); } else { - # can't write the file, so embed it in a data uri + # in preview mode, embed the image in a data uri + # to avoid temp file clutter eval q{use MIME::Base64}; error($@) if $@; return " Date: Sat, 31 Jul 2010 15:54:25 -0400 Subject: Use Digest::SHA built into perl rather than external Digest::SHA1 to simplify dependencies. Closes: #591040 --- Bundle/IkiWiki/Extras.pm | 1 - IkiWiki/Plugin/graphviz.pm | 4 ++-- IkiWiki/Plugin/search.pm | 6 +++--- IkiWiki/Plugin/sparkline.pm | 4 ++-- debian/changelog | 2 ++ debian/control | 2 +- doc/plugins/graphviz.mdwn | 2 +- doc/plugins/search.mdwn | 2 +- doc/plugins/sparkline.mdwn | 2 +- ikiwiki.spec | 1 - 10 files changed, 13 insertions(+), 13 deletions(-) (limited to 'IkiWiki/Plugin/graphviz.pm') diff --git a/Bundle/IkiWiki/Extras.pm b/Bundle/IkiWiki/Extras.pm index 5bbd7b8c6..64e907306 100644 --- a/Bundle/IkiWiki/Extras.pm +++ b/Bundle/IkiWiki/Extras.pm @@ -16,7 +16,6 @@ perl -MCPAN -e 'install Bundle::IkiWiki::Extras' =head1 CONTENTS -Digest::SHA1 Authen::Passphrase Search::Xapian RPC::XML diff --git a/IkiWiki/Plugin/graphviz.pm b/IkiWiki/Plugin/graphviz.pm index dfd66a03e..4ed8b89f1 100644 --- a/IkiWiki/Plugin/graphviz.pm +++ b/IkiWiki/Plugin/graphviz.pm @@ -37,10 +37,10 @@ sub render_graph (\%) { $src .= "}\n"; # Use the sha1 of the graphviz code as part of its filename. - eval q{use Digest::SHA1}; + eval q{use Digest::SHA}; error($@) if $@; my $dest=$params{page}."/graph-". - IkiWiki::possibly_foolish_untaint(Digest::SHA1::sha1_hex($src)). + IkiWiki::possibly_foolish_untaint(Digest::SHA::sha1_hex($src)). ".png"; will_render($params{page}, $dest); diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index 1cf762fce..8fb9dff0c 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -190,15 +190,15 @@ sub pageterm ($) { # 240 is the number used by omindex to decide when to hash an # overlong term. This does not use a compatible hash method though. if (length $page > 240) { - eval q{use Digest::SHA1}; + eval q{use Digest::SHA}; if ($@) { - debug("search: ".sprintf(gettext("need Digest::SHA1 to index %s"), $page)) if $@; + debug("search: ".sprintf(gettext("need Digest::SHA to index %s"), $page)) if $@; return undef; } # Note no colon, therefore it's guaranteed to not overlap # with a page with the same name as the hash.. - return "U".lc(Digest::SHA1::sha1_hex($page)); + return "U".lc(Digest::SHA::sha1_hex($page)); } else { return "U:".$page; diff --git a/IkiWiki/Plugin/sparkline.pm b/IkiWiki/Plugin/sparkline.pm index 1b1d04cba..e28d2605a 100644 --- a/IkiWiki/Plugin/sparkline.pm +++ b/IkiWiki/Plugin/sparkline.pm @@ -122,10 +122,10 @@ sub preprocess (@) { # Use the sha1 of the php code that generates the sparkline as # the base for its filename. - eval q{use Digest::SHA1}; + eval q{use Digest::SHA}; error($@) if $@; my $fn=$params{page}."/sparkline-". - IkiWiki::possibly_foolish_untaint(Digest::SHA1::sha1_hex($php)). + IkiWiki::possibly_foolish_untaint(Digest::SHA::sha1_hex($php)). ".png"; will_render($params{page}, $fn); diff --git a/debian/changelog b/debian/changelog index 5645b34d4..25123cecc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,8 @@ ikiwiki (3.20100723) UNRELEASED; urgency=low * meta: Allow syntax closer to html meta to be used. * Add new disable hook, allowing plugins to perform cleanup after they have been disabled. + * Use Digest::SHA built into perl rather than external Digest::SHA1 + to simplify dependencies. Closes: #591040 -- Joey Hess Fri, 23 Jul 2010 14:00:32 -0400 diff --git a/debian/control b/debian/control index 0562a4a99..049a685b0 100644 --- a/debian/control +++ b/debian/control @@ -34,7 +34,7 @@ Suggests: viewvc | gitweb | viewcvs, libsearch-xapian-perl, libxml-feed-perl, libmailtools-perl, perlmagick, libfile-mimeinfo-perl, libcrypt-ssleay-perl, liblocale-gettext-perl (>= 1.05-1), libtext-typography-perl, - libtext-csv-perl, libdigest-sha1-perl, graphviz, libnet-amazon-s3-perl, + libtext-csv-perl, graphviz, libnet-amazon-s3-perl, libsparkline-php, texlive, dvipng, libtext-wikicreole-perl, libsort-naturally-perl, libtext-textile-perl, libhighlight-perl, po4a (>= 0.35-1), gettext, libyaml-perl diff --git a/doc/plugins/graphviz.mdwn b/doc/plugins/graphviz.mdwn index 65130ae8c..d57d7dc94 100644 --- a/doc/plugins/graphviz.mdwn +++ b/doc/plugins/graphviz.mdwn @@ -22,4 +22,4 @@ Some example graphs: [[!graph src="a -- b -- c -- a;" prog="circo" type="graph"]] """]] -This plugin uses the [[!cpan Digest::SHA1]] perl module. +This plugin uses the [[!cpan Digest::SHA]] perl module. diff --git a/doc/plugins/search.mdwn b/doc/plugins/search.mdwn index 92cc5945a..e95739cf3 100644 --- a/doc/plugins/search.mdwn +++ b/doc/plugins/search.mdwn @@ -4,7 +4,7 @@ This plugin adds full text search to ikiwiki, using the [xapian](http://xapian.org/) engine, its [omega](http://xapian.org/docs/omega/overview.html) frontend, and the -[[!cpan Search::Xapian]], [[!cpan Digest::SHA1]], and [[!cpan HTML::Scrubber]] +[[!cpan Search::Xapian]], [[!cpan Digest::SHA]], and [[!cpan HTML::Scrubber]] perl modules. The [[ikiwiki/searching]] page describes how to write search queries. diff --git a/doc/plugins/sparkline.mdwn b/doc/plugins/sparkline.mdwn index ee3928d7e..83e24a27d 100644 --- a/doc/plugins/sparkline.mdwn +++ b/doc/plugins/sparkline.mdwn @@ -16,7 +16,7 @@ to use the plugin, you will need: php can find it when `sparkline/Sparkline.php` is required. * The GD PHP module used by the Sparkline library. * A "php" program in the path, that can run standalone php programs. -* [[!cpan Digest::SHA1]] +* [[!cpan Digest::SHA]] On a Debian system, this can be accomplished by installing these packages: `libsparkline-php` `php5-gd` `php5-cli` `libdigest-sha1-perl` diff --git a/ikiwiki.spec b/ikiwiki.spec index 43065b7f5..ca5794704 100644 --- a/ikiwiki.spec +++ b/ikiwiki.spec @@ -31,7 +31,6 @@ Requires: perl(HTML::Scrubber) Requires: perl(XML::Simple) Requires: perl(CGI::FormBuilder) Requires: perl(CGI::Session) -Requires: perl(Digest::SHA1) Requires: python-docutils -- cgit v1.2.3