summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-03-07 07:41:07 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-03-07 07:41:07 +0000
commit4cbb1095d62b9b2ded9546040e4bc5f5b0faef67 (patch)
tree6566313d4f07ee0757d9b39efccbf360e2f6d1de
parent7ae2deacdf5ebf7274da8c77daf42b43aca985c0 (diff)
support previewing of sparklines: embed in data uris for preview
-rw-r--r--IkiWiki/Plugin/sparkline.pm15
-rw-r--r--doc/plugins/sparkline.mdwn5
-rw-r--r--po/bg.po13
-rw-r--r--po/cs.po13
-rw-r--r--po/es.po13
-rw-r--r--po/fr.po13
-rw-r--r--po/gu.po13
-rw-r--r--po/ikiwiki.pot8
-rw-r--r--po/pl.po13
-rw-r--r--po/sv.po13
-rw-r--r--po/vi.po13
11 files changed, 62 insertions, 70 deletions
diff --git a/IkiWiki/Plugin/sparkline.pm b/IkiWiki/Plugin/sparkline.pm
index a44e06252..63c2cf943 100644
--- a/IkiWiki/Plugin/sparkline.pm
+++ b/IkiWiki/Plugin/sparkline.pm
@@ -108,10 +108,6 @@ sub preprocess (@) { #{{{
$php.=qq{\$sparkline->RenderResampled($width, $height);\n};
}
- if ($params{preview}) {
- return "[[".gettext("sparkline previewing not implemented")."]]";
- }
-
$php.=qq{\$sparkline->Output();\n?>\n};
# Use the sha1 of the php code that generates the sparkline as
@@ -148,7 +144,16 @@ sub preprocess (@) { #{{{
return "[[".gettext("sparkline failed to run php")."]]";
}
- writefile($fn, $config{destdir}, $png, 1);
+ if (! $params{preview}) {
+ writefile($fn, $config{destdir}, $png, 1);
+ }
+ else {
+ # can't write the file, so embed it in a data uri
+ eval q{use MIME::Base64};
+ error($@) if $@;
+ return "<img src=\"data:image/png;base64,".
+ encode_base64($png)."\" />";
+ }
}
return '<img src="'.
diff --git a/doc/plugins/sparkline.mdwn b/doc/plugins/sparkline.mdwn
index 738c6fa95..1b22054a6 100644
--- a/doc/plugins/sparkline.mdwn
+++ b/doc/plugins/sparkline.mdwn
@@ -17,9 +17,8 @@ to use the plugin, you will need:
* A "php" program in the path, that can run standalone php programs.
* [[cpan Digest::SHA1]]
-On a Debian system, this can be accomplished by installing the
-`libsparkline-php`, `php5-gd`, `php5-cli`, and `libdigest-sha1-perl`
-packages.
+On a Debian system, this can be accomplished by installing these packages:
+`libsparkline-php` `php5-gd` `php5-cli` `libdigest-sha1-perl`
# examples
diff --git a/po/bg.po b/po/bg.po
index 3e5438133..05603d833 100644
--- a/po/bg.po
+++ b/po/bg.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ikiwiki-bg\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-03-07 01:22-0500\n"
+"POT-Creation-Date: 2007-03-07 02:29-0500\n"
"PO-Revision-Date: 2007-01-12 01:19+0200\n"
"Last-Translator: Damyan Ivanov <dam@modsodtsys.com>\n"
"Language-Team: Bulgarian <dict@fsa-bg.org>\n"
@@ -343,12 +343,7 @@ msgstr "липсващ параметър „id” на шаблона"
msgid "sparkline bad width value"
msgstr "приставката „linkmap”: грешка при изпълнение на „dot”"
-#: ../IkiWiki/Plugin/sparkline.pm:112
-#, fuzzy
-msgid "sparkline previewing not implemented"
-msgstr "функцията „getctime” не е реализирана"
-
-#: ../IkiWiki/Plugin/sparkline.pm:148
+#: ../IkiWiki/Plugin/sparkline.pm:144
#, fuzzy
msgid "sparkline failed to run php"
msgstr "приставката „linkmap”: грешка при изпълнение на „dot”"
@@ -509,3 +504,7 @@ msgstr "Грешка"
#, perl-format
msgid "%s preprocessing loop detected on %s at depth %i"
msgstr "открита е циклична завидимост при %s на „%s” на дълбочина %i"
+
+#, fuzzy
+#~ msgid "sparkline previewing not implemented"
+#~ msgstr "функцията „getctime” не е реализирана"
diff --git a/po/cs.po b/po/cs.po
index 70c90d7df..3197174cf 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ikiwiki\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-03-07 01:22-0500\n"
+"POT-Creation-Date: 2007-03-07 02:29-0500\n"
"PO-Revision-Date: 2007-02-17 12:07+0100\n"
"Last-Translator: Miroslav Kure <kurem@debian.cz>\n"
"Language-Team: Czech <debian-l10n-czech@lists.debian.org>\n"
@@ -339,12 +339,7 @@ msgstr "šabloně chybí parametr id"
msgid "sparkline bad width value"
msgstr "linkmapu se nepodařilo spustit dot"
-#: ../IkiWiki/Plugin/sparkline.pm:112
-#, fuzzy
-msgid "sparkline previewing not implemented"
-msgstr "getctime není implementováno"
-
-#: ../IkiWiki/Plugin/sparkline.pm:148
+#: ../IkiWiki/Plugin/sparkline.pm:144
#, fuzzy
msgid "sparkline failed to run php"
msgstr "linkmapu se nepodařilo spustit dot"
@@ -503,5 +498,9 @@ msgstr "Chyba"
msgid "%s preprocessing loop detected on %s at depth %i"
msgstr "Byla rozpoznána smyčka direktivy %s na %s v hloubce %i"
+#, fuzzy
+#~ msgid "sparkline previewing not implemented"
+#~ msgstr "getctime není implementováno"
+
#~ msgid "in late morning %A"
#~ msgstr "%A pozdě dopoledne"
diff --git a/po/es.po b/po/es.po
index 14ebddccb..73cd380db 100644
--- a/po/es.po
+++ b/po/es.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: es\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-03-07 01:22-0500\n"
+"POT-Creation-Date: 2007-03-07 02:29-0500\n"
"PO-Revision-Date: 2007-02-12 10:31+0100\n"
"Last-Translator: Víctor Moral <victor@taquiones.net>\n"
"Language-Team: spanish <es@li.org>\n"
@@ -345,12 +345,7 @@ msgstr "A el complemento template le falta el parámetro id"
msgid "sparkline bad width value"
msgstr "El complemento linkmap no ha podido ejecutar el programa dot"
-#: ../IkiWiki/Plugin/sparkline.pm:112
-#, fuzzy
-msgid "sparkline previewing not implemented"
-msgstr "la funcionalidad getctime no está incluida"
-
-#: ../IkiWiki/Plugin/sparkline.pm:148
+#: ../IkiWiki/Plugin/sparkline.pm:144
#, fuzzy
msgid "sparkline failed to run php"
msgstr "El complemento linkmap no ha podido ejecutar el programa dot"
@@ -516,3 +511,7 @@ msgid "%s preprocessing loop detected on %s at depth %i"
msgstr ""
"se ha detectado un bucle de preprocesado %s en la página %s en la vuelta "
"número %i"
+
+#, fuzzy
+#~ msgid "sparkline previewing not implemented"
+#~ msgstr "la funcionalidad getctime no está incluida"
diff --git a/po/fr.po b/po/fr.po
index 5d61d5779..2a61182ab 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ikiwiki\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-03-07 01:22-0500\n"
+"POT-Creation-Date: 2007-03-07 02:29-0500\n"
"PO-Revision-Date: 2007-02-13 13:02+0100\n"
"Last-Translator: Jean-Luc Coulon (f5ibh) <jean-luc.coulon@wanadoo.fr>\n"
"Language-Team: French <debian-l10n-french@lists.debian.org>\n"
@@ -344,12 +344,7 @@ msgstr "Paramètre d'identification manquant dans le modèle"
msgid "sparkline bad width value"
msgstr "Échec de lancement de dot par linkmap"
-#: ../IkiWiki/Plugin/sparkline.pm:112
-#, fuzzy
-msgid "sparkline previewing not implemented"
-msgstr "getctime n'est pas implémenté"
-
-#: ../IkiWiki/Plugin/sparkline.pm:148
+#: ../IkiWiki/Plugin/sparkline.pm:144
#, fuzzy
msgid "sparkline failed to run php"
msgstr "Échec de lancement de dot par linkmap"
@@ -514,3 +509,7 @@ msgid "%s preprocessing loop detected on %s at depth %i"
msgstr ""
"%s une boucle a été détectée dans le prétraitement de %s, à la profondeur de "
"%i"
+
+#, fuzzy
+#~ msgid "sparkline previewing not implemented"
+#~ msgstr "getctime n'est pas implémenté"
diff --git a/po/gu.po b/po/gu.po
index bcec055fa..53914d1b1 100644
--- a/po/gu.po
+++ b/po/gu.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ikiwiki-gu\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-03-07 01:22-0500\n"
+"POT-Creation-Date: 2007-03-07 02:29-0500\n"
"PO-Revision-Date: 2007-01-11 16:05+0530\n"
"Last-Translator: Kartik Mistry <kartik.mistry@gmail.com>\n"
"Language-Team: Gujarati <team@utkarsh.org>\n"
@@ -337,12 +337,7 @@ msgstr "ટેમ્પલેટને આઇડી વિકલ્પ મળત
msgid "sparkline bad width value"
msgstr "લીંકમેપ ડોટ ચલાવવામાં નિષ્ફળ"
-#: ../IkiWiki/Plugin/sparkline.pm:112
-#, fuzzy
-msgid "sparkline previewing not implemented"
-msgstr "getctime અમલમાં મૂકાયેલ નથી"
-
-#: ../IkiWiki/Plugin/sparkline.pm:148
+#: ../IkiWiki/Plugin/sparkline.pm:144
#, fuzzy
msgid "sparkline failed to run php"
msgstr "લીંકમેપ ડોટ ચલાવવામાં નિષ્ફળ"
@@ -499,3 +494,7 @@ msgstr "ક્ષતિ"
#, perl-format
msgid "%s preprocessing loop detected on %s at depth %i"
msgstr "%s પર શોધાયેલ લુપ %s પર ચલાવે છે %i ઉંડાણ પર"
+
+#, fuzzy
+#~ msgid "sparkline previewing not implemented"
+#~ msgstr "getctime અમલમાં મૂકાયેલ નથી"
diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot
index 6fb6a901a..f53c6bd4e 100644
--- a/po/ikiwiki.pot
+++ b/po/ikiwiki.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-03-07 01:22-0500\n"
+"POT-Creation-Date: 2007-03-07 02:29-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -334,11 +334,7 @@ msgstr ""
msgid "sparkline bad width value"
msgstr ""
-#: ../IkiWiki/Plugin/sparkline.pm:112
-msgid "sparkline previewing not implemented"
-msgstr ""
-
-#: ../IkiWiki/Plugin/sparkline.pm:148
+#: ../IkiWiki/Plugin/sparkline.pm:144
msgid "sparkline failed to run php"
msgstr ""
diff --git a/po/pl.po b/po/pl.po
index d22f5ee1c..ffbb4b586 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ikiwiki 1.37\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-03-07 01:22-0500\n"
+"POT-Creation-Date: 2007-03-07 02:29-0500\n"
"PO-Revision-Date: 2007-01-05 16:33+100\n"
"Last-Translator: Paweł Tęcza <ptecza@net.icm.edu.pl>\n"
"Language-Team: Debian L10n Polish <debian-l10n-polish@lists.debian.org>\n"
@@ -347,12 +347,7 @@ msgstr "brakujący parametr id we wtyczce template"
msgid "sparkline bad width value"
msgstr "awaria wtyczki linkmap"
-#: ../IkiWiki/Plugin/sparkline.pm:112
-#, fuzzy
-msgid "sparkline previewing not implemented"
-msgstr "niedostępna funkcja getctime"
-
-#: ../IkiWiki/Plugin/sparkline.pm:148
+#: ../IkiWiki/Plugin/sparkline.pm:144
#, fuzzy
msgid "sparkline failed to run php"
msgstr "awaria wtyczki linkmap"
@@ -513,3 +508,7 @@ msgstr "Błąd"
#, perl-format
msgid "%s preprocessing loop detected on %s at depth %i"
msgstr "polecenie preprocesora %s wykryte w %s na głębokości %i"
+
+#, fuzzy
+#~ msgid "sparkline previewing not implemented"
+#~ msgstr "niedostępna funkcja getctime"
diff --git a/po/sv.po b/po/sv.po
index e99d17358..8800177f2 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ikiwiki\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-03-07 01:22-0500\n"
+"POT-Creation-Date: 2007-03-07 02:29-0500\n"
"PO-Revision-Date: 2007-01-10 23:47+0100\n"
"Last-Translator: Daniel Nylander <po@danielnylander.se>\n"
"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
@@ -339,12 +339,7 @@ msgstr "mall saknar id-parameter"
msgid "sparkline bad width value"
msgstr "linkmap misslyckades att köra dot"
-#: ../IkiWiki/Plugin/sparkline.pm:112
-#, fuzzy
-msgid "sparkline previewing not implemented"
-msgstr "getctime inte implementerad"
-
-#: ../IkiWiki/Plugin/sparkline.pm:148
+#: ../IkiWiki/Plugin/sparkline.pm:144
#, fuzzy
msgid "sparkline failed to run php"
msgstr "linkmap misslyckades att köra dot"
@@ -503,3 +498,7 @@ msgstr "Fel"
#, perl-format
msgid "%s preprocessing loop detected on %s at depth %i"
msgstr "%s förbehandlingsslinga detekterades på %s, djup %i"
+
+#, fuzzy
+#~ msgid "sparkline previewing not implemented"
+#~ msgstr "getctime inte implementerad"
diff --git a/po/vi.po b/po/vi.po
index 93527efaf..ea96c3d88 100644
--- a/po/vi.po
+++ b/po/vi.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ikiwiki\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-03-07 01:22-0500\n"
+"POT-Creation-Date: 2007-03-07 02:29-0500\n"
"PO-Revision-Date: 2007-01-13 15:31+1030\n"
"Last-Translator: Clytie Siddall <clytie@riverland.net.au>\n"
"Language-Team: Vietnamese <vi-VN@googlegroups.com>\n"
@@ -340,12 +340,7 @@ msgstr "mẫu thiếu tham số id"
msgid "sparkline bad width value"
msgstr "linkmap không chạy dot được"
-#: ../IkiWiki/Plugin/sparkline.pm:112
-#, fuzzy
-msgid "sparkline previewing not implemented"
-msgstr "chưa thực hiện getctime"
-
-#: ../IkiWiki/Plugin/sparkline.pm:148
+#: ../IkiWiki/Plugin/sparkline.pm:144
#, fuzzy
msgid "sparkline failed to run php"
msgstr "linkmap không chạy dot được"
@@ -504,3 +499,7 @@ msgstr "Lỗi"
#, perl-format
msgid "%s preprocessing loop detected on %s at depth %i"
msgstr "vòng lặp tiền xử lý %s được phát hiện trên %s ở độ sâu %i"
+
+#, fuzzy
+#~ msgid "sparkline previewing not implemented"
+#~ msgstr "chưa thực hiện getctime"