From 97a706f73ce2cedc8fd8a9bbeea6d25783260b2e Mon Sep 17 00:00:00 2001 From: intrigeri Date: Mon, 2 Aug 2010 15:14:33 +0200 Subject: both are now fixed in my po branch. --- doc/plugins/po.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 0f1d66d32..91273ba98 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -315,3 +315,6 @@ underlay, and the underlays lack translation to a given language. >>>>>> although they do not in this case. I still need to have a deep >>>>>> look at the underlays-related code you added to `po.pm` a while >>>>>> ago. Stay tuned. --[[intrigeri]] + +>>>>>>> Fixed in my po branch, along with other related small bugs that +>>>>>>> happen in the very same situation only. --[[intrigeri]] -- cgit v1.2.3 From 5bbbdbecbbe1e68b65baf35c3d8b8a371c9341b2 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Fri, 6 Aug 2010 08:12:11 +0000 Subject: update docs for new version --- doc/plugins/contrib/ymlfront.mdwn | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ymlfront.mdwn b/doc/plugins/contrib/ymlfront.mdwn index 6dd8ed532..a2c649044 100644 --- a/doc/plugins/contrib/ymlfront.mdwn +++ b/doc/plugins/contrib/ymlfront.mdwn @@ -13,18 +13,21 @@ IkiWiki::Plugin::ymlfront - add YAML-format data to a page ## DESCRIPTION This plugin provides a way of adding arbitrary meta-data (data fields) to any -page by prefixing the page with a YAML-format document. This provides a way to -create per-page structured data, where each page is treated like a record, and -the structured data are fields in that record. This can include the meta-data -for that page, such as the page title. +page by prefixing the page with a YAML-format document. This also provides +the [[ikiwiki/directive/ymlfront]] directive, which enables one to put +YAML-formatted data inside a standard IkiWiki [[ikiwiki/directive]]. + +This is a way to create per-page structured data, where each page is +treated like a record, and the structured data are fields in that record. This +can include the meta-data for that page, such as the page title. This plugin is meant to be used in conjunction with the [[field]] plugin. ## DETAILS -The YAML-format data in a page must be placed at the start of the page -and delimited by lines containing precisely three dashes. The "normal" -content of the page then follows. +If one is not using the ymlfront directive, the YAML-format data in a page +must be placed at the start of the page and delimited by lines containing +precisely three dashes. The "normal" content of the page then follows. For example: @@ -42,7 +45,7 @@ That will be htmlized using the page-type of the page-file. ### Accessing the Data -There are a few ways to access the data given in the YAML section. +There are a few ways to access the given YAML data. * [[getfield]] plugin -- cgit v1.2.3 From f78357348a028fe97037429f4712d511d2921b14 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Fri, 6 Aug 2010 08:13:48 +0000 Subject: ymlfront now provides a ymlfront directive --- doc/plugins/contrib/ikiwiki/directive/ymlfront.mdwn | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 doc/plugins/contrib/ikiwiki/directive/ymlfront.mdwn (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ikiwiki/directive/ymlfront.mdwn b/doc/plugins/contrib/ikiwiki/directive/ymlfront.mdwn new file mode 100644 index 000000000..bb4a58fc6 --- /dev/null +++ b/doc/plugins/contrib/ikiwiki/directive/ymlfront.mdwn @@ -0,0 +1,17 @@ +The `ymlfront` directive is supplied by the [[!iki plugins/contrib/ymlfront desc=ymlfront]] plugin. + +This directive allows the user to define arbitrary meta-data in YAML format. + + \[[!ymlfront data=""" + foo: fooness + bar: The Royal Pigeon + baz: 2 + """]] + +There is one argument to this directive. + +* **data:** + The YAML-format data. This should be enclosed inside triple-quotes to preserve the data correctly. + +If more than one ymlfront directive is given per page, the result is undefined. +Likewise, it is inadvisable to try to mix the "---" ymlfront format with the directive form of the data. -- cgit v1.2.3 From 0497b6379285df3c505c701ddfc9886922e85054 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Fri, 6 Aug 2010 08:19:06 +0000 Subject: Should I remove the old ymlfront format now that it recognises directives? --- doc/plugins/contrib/ymlfront/discussion.mdwn | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ymlfront/discussion.mdwn b/doc/plugins/contrib/ymlfront/discussion.mdwn index b5c08fedd..3f7f0a337 100644 --- a/doc/plugins/contrib/ymlfront/discussion.mdwn +++ b/doc/plugins/contrib/ymlfront/discussion.mdwn @@ -1,13 +1,5 @@ -My field-etc branch in git://git.pseudorandom.co.uk/git/smcv/ikiwiki.git (gitweb: -) -has some fixes for compatibility with old YAML modules, mostly done by imitating -Joey's code in IkiWiki::Setup::Yaml. Please consider merging :-) --[[smcv]] +Now that I have implemented a \[[!ymlfront ...]] directive, I would like to remove support for the old "---" delimited format, because +* it is fragile (easily breakable) +* it is non-standard -> I would if I could *find* it. I checked out the "field-etc" branch, but I can't find the plugins in question under IkiWiki/Plugin; am I looking in the wrong place, or what? -> --[[KathrynAndersen]] - ->> Sorry, I accidentally removed `field-etc` by pushing with `--mirror` from a ->> different checkout. I've put it back; it's a branch from your `ikiplugins.git`, ->> so yes, the code should be in `IkiWiki/Plugin`. --[[smcv]] - ->>> Done a while back, but now I've actually pushed to my repo. --[[KathrynAndersen]] +Any objections? -- cgit v1.2.3 From d2b50c37b44972e60d08854e9e780a09481872d5 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Fri, 6 Aug 2010 08:19:39 +0000 Subject: formatting --- doc/plugins/contrib/ymlfront/discussion.mdwn | 1 + 1 file changed, 1 insertion(+) (limited to 'doc/plugins') diff --git a/doc/plugins/contrib/ymlfront/discussion.mdwn b/doc/plugins/contrib/ymlfront/discussion.mdwn index 3f7f0a337..b1fd65fff 100644 --- a/doc/plugins/contrib/ymlfront/discussion.mdwn +++ b/doc/plugins/contrib/ymlfront/discussion.mdwn @@ -1,4 +1,5 @@ Now that I have implemented a \[[!ymlfront ...]] directive, I would like to remove support for the old "---" delimited format, because + * it is fragile (easily breakable) * it is non-standard -- cgit v1.2.3 From 51d5e546974405741e08ed27d0bf89958fa7366b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 9 Aug 2010 13:18:59 -0400 Subject: filecheck: Fall back to using the file command if the freedesktop magic file cannot identify a file. --- IkiWiki/Plugin/filecheck.pm | 25 +++++++++++++++++++------ debian/changelog | 7 +++++++ doc/plugins/filecheck.mdwn | 3 ++- 3 files changed, 28 insertions(+), 7 deletions(-) (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/filecheck.pm b/IkiWiki/Plugin/filecheck.pm index d00b6dfd3..a78058ffe 100644 --- a/IkiWiki/Plugin/filecheck.pm +++ b/IkiWiki/Plugin/filecheck.pm @@ -132,15 +132,28 @@ sub match_mimetype ($$;@) { return IkiWiki::ErrorReason->new("file does not exist"); } - # Use ::magic to get the mime type, the idea is to only trust - # data obtained by examining the actual file contents. + # Get the mime type. + # + # First, try File::Mimeinfo. This is fast, but doesn't recognise + # all files. eval q{use File::MimeInfo::Magic}; - if ($@) { - return IkiWiki::ErrorReason->new("failed to load File::MimeInfo::Magic ($@); cannot check MIME type"); + my $mimeinfo_ok=! $@; + my $mimetype; + if ($mimeinfo_ok) { + my $mimetype=File::MimeInfo::Magic::magic($file); } - my $mimetype=File::MimeInfo::Magic::magic($file); + + # Fall back to using file, which has a more complete + # magic database. if (! defined $mimetype) { - $mimetype=File::MimeInfo::Magic::default($file); + open(my $file_h, "-|", "file", "-bi", $file); + $mimetype=<$file_h>; + close $file_h; + } + if (! defined $mimetype || $mimetype !~s /;.*//) { + # Fall back to default value. + $mimetype=File::MimeInfo::Magic::default($file) + if $mimeinfo_ok; if (! defined $mimetype) { $mimetype="unknown"; } diff --git a/debian/changelog b/debian/changelog index 8223074f3..440bee34f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ikiwiki (3.20100805) UNRELEASED; urgency=low + + * filecheck: Fall back to using the file command if the freedesktop + magic file cannot identify a file. + + -- Joey Hess Mon, 09 Aug 2010 13:18:28 -0400 + ikiwiki (3.20100804) unstable; urgency=low * template: Fix dependency tracking. Broken in version 3.20100427. diff --git a/doc/plugins/filecheck.mdwn b/doc/plugins/filecheck.mdwn index e5f68b29c..b038bc433 100644 --- a/doc/plugins/filecheck.mdwn +++ b/doc/plugins/filecheck.mdwn @@ -7,7 +7,8 @@ status. These tests are mostly useful for the [[attachment]] plugin, and are documented [[here|ikiwiki/pagespec/attachment]]. This plugin will use the [[!cpan File::MimeInfo::Magic]] perl module, if -available, for mimetype checking. +available, for mimetype checking. It falls back to using the `file` command +if necessary for hard to detect files. The `virusfree` [[PageSpec|ikiwiki/pagespec/attachment]] requires that ikiwiki be configured with a virus scanner program via the `virus_checker` -- cgit v1.2.3 From 80102c042d0f2fd194222cd233a7bfd0e8bd467f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 12 Aug 2010 16:53:52 -0400 Subject: flattr: New plugin. Thanks to jaywalk for the initial implementation at a flattr plugin! This one is less configurable, but simpler. --- IkiWiki/Plugin/flattr.pm | 97 +++++++++++++++++++++++++++++++++++++++ debian/changelog | 2 + doc/ikiwiki/directive/flattr.mdwn | 45 ++++++++++++++++++ doc/plugins/contrib/flattr.mdwn | 3 ++ doc/plugins/flattr.mdwn | 9 ++++ doc/style.css | 4 ++ 6 files changed, 160 insertions(+) create mode 100644 IkiWiki/Plugin/flattr.pm create mode 100644 doc/ikiwiki/directive/flattr.mdwn create mode 100644 doc/plugins/flattr.mdwn (limited to 'doc/plugins') diff --git a/IkiWiki/Plugin/flattr.pm b/IkiWiki/Plugin/flattr.pm new file mode 100644 index 000000000..3aee1eb93 --- /dev/null +++ b/IkiWiki/Plugin/flattr.pm @@ -0,0 +1,97 @@ +#!/usr/bin/perl +package IkiWiki::Plugin::flattr; + +use warnings; +use strict; +use IkiWiki 3.00; + +sub import { + hook(type => "getsetup", id => "flattr", call => \&getsetup); + hook(type => "preprocess", id => "flattr", call => \&preprocess); + hook(type => "format", id => "flattr", call => \&format); +} + +sub getsetup () { + return + plugin => { + safe => 1, + rebuild => undef, + }, + flattr_userid => { + type => "string", + example => 'joeyh', + description => "userid or user name to use by default for Flattr buttons", + advanced => 0, + safe => 1, + rebuild => undef, + }, +} + +my %flattr_pages; + +sub preprocess (@) { + my %params=@_; + + $flattr_pages{$params{destpage}}=1; + + my $url=$params{url}; + if (! defined $url) { + $url=urlto($params{page}, "", 1); + } + + my @fields; + foreach my $field (qw{language uid button hidden category tags}) { + if (exists $params{$field}) { + push @fields, "$field:$params{$field}"; + } + } + + return ''. + (exists $params{description} ? $params{description} : ''). + ''; +} + +sub format (@) { + my %params=@_; + + # Add flattr's javascript to pages with flattr buttons. + if ($flattr_pages{$params{page}}) { + if (! ($params{content}=~s!^(]*>)!$1.flattrjs()!em)) { + # no tag, probably in preview mode + $params{content}=flattrjs().$params{content}; + } + } + return $params{content}; +} + +my $js_cached; +sub flattrjs { + return $js_cached if defined $js_cached; + + my $js_url='https://api.flattr.com/js/0.5.0/load.js?mode=auto'; + if (defined $config{flattr_userid}) { + my $userid=$config{flattr_userid}; + $userid=~s/[^-A-Za-z0-9_]//g; # sanitize for inclusion in javascript + $js_url.="&uid=$userid"; + } + + # This is Flattr's standard javascript snippet to include their + # external javascript file, asynchronously. + return $js_cached=<<"EOF"; + +EOF +} + +1 diff --git a/debian/changelog b/debian/changelog index 440bee34f..f90fd8855 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ ikiwiki (3.20100805) UNRELEASED; urgency=low * filecheck: Fall back to using the file command if the freedesktop magic file cannot identify a file. + * flattr: New plugin. (Thanks to jaywalk for the initial implementation + at a flattr plugin! This one is less configurable, but simpler.) -- Joey Hess Mon, 09 Aug 2010 13:18:28 -0400 diff --git a/doc/ikiwiki/directive/flattr.mdwn b/doc/ikiwiki/directive/flattr.mdwn new file mode 100644 index 000000000..5083005ce --- /dev/null +++ b/doc/ikiwiki/directive/flattr.mdwn @@ -0,0 +1,45 @@ +The `flattr` directive is supplied by the [[!iki plugins/flattr desc=flattr]] plugin. + +This directive allows easily inserting Flattr buttons onto wiki pages. + +Flattr supports both static buttons and javascript buttons. This directive +only creates dynamic javascript buttons. If you want to insert a static +Flattr button, you can simply copy the html code for it from Flattr, instead. +Note that this directive inserts javascript code into the page, that +loads more javascript code from Flattr.com. So only use it if you feel +comfortable with that. + +The directive can be used to display a button for a thing you have already +manually submitted to Flattr. In this mode, the only parameter you need to +include is the exact url to the thing that was submitted to Flattr. +(If the button is for the current page, you can leave that out.) For +example, this is the Flattr button for ikiwiki. Feel free to add it to all +your pages. ;) + + \[[!flattr url="http://ikiwiki.info/" button=compact]] + +The directive can also be used to create a button that automatically +submits a page to Flattr when a user clicks on it. In this mode you +need to include parameters to specify your uid, and a title, category, tags, +and description for the page. For example, this is a Flattr button for +a blog post: + + \[[!flattr uid=25634 title="my new blog post" category=text + tags="blog,example" description="This is a post on my blog."]] + +Here are all possible parameters you can pass to the Flattr directive. + +* `button` - Set to "compact" for a small button. +* `url` - The url to the thing to be Flattr'd. If omitted, defaults + to the url of the current page. +* `uid` - Your numeric Flattr userid. Not needed if the flattr plugin + has been configured with a global `flattr_userid`. +* `title` - A short title for the thing, to show on its Flattr page. +* `description` - A description of the thing, to show on its Flattr + page. +* `category` - One of: text, images, video, audio, software, rest. +* `tags` - A list of tags separated by a comma. +* `language` - A language code. +* `hidden` - Set to 1 to hide the button from listings on Flattr.com. + +[[!meta robots="noindex, follow"]] diff --git a/doc/plugins/contrib/flattr.mdwn b/doc/plugins/contrib/flattr.mdwn index f8f005c31..e9b4bf857 100644 --- a/doc/plugins/contrib/flattr.mdwn +++ b/doc/plugins/contrib/flattr.mdwn @@ -10,6 +10,9 @@ I wrote some notes on [jonatan.walck.se](http://jonatan.walck.se/software/ikiwik This plugin is licensed under [CC0](http://creativecommons.org/publicdomain/zero/1.0/) (public domain). +Note that there is now a [[plugins/flattr]] plugin bundled with ikiwiki. It +is less configurable, not supporting static buttons, but simpler to use. + # Usage # # [[!flattr args]] where args are in the form of arg=value. diff --git a/doc/plugins/flattr.mdwn b/doc/plugins/flattr.mdwn new file mode 100644 index 000000000..5da279518 --- /dev/null +++ b/doc/plugins/flattr.mdwn @@ -0,0 +1,9 @@ +[[!template id=plugin name=flattr author="[[Joey]]"]] +[[!tag type/web]] + +[Flattr](http://flattr.com/) is a social micropayment platform. +This plugin allows easily adding Flattr buttons to pages, +using the [[ikiwiki/directive/flattr]] directive. + +This plugin has a configuration setting. `flattr_userid` can be set +to either your numeric flatter userid, or your flattr username. diff --git a/doc/style.css b/doc/style.css index 8dd3b1c15..66d962bd6 100644 --- a/doc/style.css +++ b/doc/style.css @@ -449,6 +449,10 @@ li.L8 { list-style: upper-alpha; } background: #ff9900; } +.FlattrButton { + display: none; +} + /* openid selector */ #openid_choice { display: none; -- cgit v1.2.3 From 8a0b2d07d3aa1a833e9b83ce9e2a9b2a6f76fb9b Mon Sep 17 00:00:00 2001 From: "http://weakish.myopenid.com/" Date: Fri, 13 Aug 2010 16:13:06 +0000 Subject: possible to use place holders? --- doc/plugins/rst/discussion.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/rst/discussion.mdwn b/doc/plugins/rst/discussion.mdwn index 3c3b03275..c84a6218e 100644 --- a/doc/plugins/rst/discussion.mdwn +++ b/doc/plugins/rst/discussion.mdwn @@ -71,3 +71,11 @@ I need help on a couple of points * Can we include this in ikiwiki's rst if it is not too hairy? --ulrik + + +---- + +> The main problem with more sophisticated RST support is that ikiwiki turns +preprocessor directives into raw HTML and reST hates inline HTML. + +Is it possible for ikiwiki to store preprocessor directives in memory, and replace them with place holders, then do the rst process. After the rst processing, process the preprocessor directives and replace place holders. --[[weakish]] -- cgit v1.2.3 From 8591fa48633375aab0e2ff4dbef940984dc7c381 Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawndltpDNFSfEZBR_TIcjeDQRkuuyT1e_3o" Date: Sat, 14 Aug 2010 22:41:57 +0000 Subject: --- doc/plugins/filecheck/discussion.mdwn | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/filecheck/discussion.mdwn b/doc/plugins/filecheck/discussion.mdwn index f91950b7d..9a3bcddfc 100644 --- a/doc/plugins/filecheck/discussion.mdwn +++ b/doc/plugins/filecheck/discussion.mdwn @@ -15,3 +15,20 @@ if ::magic() returns undef? --[[DavidBremner]] >> for ::default >>> Applied + +--- + +At first I need to thank you for ikiwiki - it is what I was always looking for - coming from a whole bunch of wiki engines, this is the most intelligent and least bloated one. + +My question is about the [[plugins/attachment]] plugin in conjunction with [[plugins/filecheck]]: I am using soundmanger2 js-library for having attached media files of all sorts played inline a page. + +To achieve this soundmanager2 asks for an id inside a ul-tag surrounding the a-tag. I was wondering if the Insert Link button could be provided with a more elegant solution than to have this code snippet to be filled in by hand every time you use it to insert links for attached media files. And in fact there apparently is a way in attachment.pm. + +While I can see that it is not needed for everyone inserting links to attached media files to have ul- and li-tags surrounding the link itself as well as being supplied with an id fill in, for me it would be the most straight forward solution. Pitty is I don't have the time to wrap my head around perl to write a patch myself. Is there any way to have this made an option which can be called via templates? + +For sure I would like to donate for such a patch as well as I will do it for ikiwiki anyway, because it is such a fine application. + +If you are not familiar with soundmanager2: It is a very straight forward solution to inline mediafiles, using the usual flash as well as html5 solutions (used by soundcloud.com, freesound.org and the like). Worth a look anyway [schillmania.com](http://www.schillmania.com/) + +Boris + -- cgit v1.2.3 From 52e3f698bc8fafdab4d911d925d214981ebd8d25 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 14 Aug 2010 20:17:12 -0400 Subject: respond, open wishlist todo item with design --- doc/plugins/filecheck/discussion.mdwn | 49 ++++++++++++++++++++++++++++++----- doc/todo/generic_insert_links | 24 +++++++++++++++++ 2 files changed, 67 insertions(+), 6 deletions(-) create mode 100644 doc/todo/generic_insert_links (limited to 'doc/plugins') diff --git a/doc/plugins/filecheck/discussion.mdwn b/doc/plugins/filecheck/discussion.mdwn index 9a3bcddfc..6ef780772 100644 --- a/doc/plugins/filecheck/discussion.mdwn +++ b/doc/plugins/filecheck/discussion.mdwn @@ -18,17 +18,54 @@ if ::magic() returns undef? --[[DavidBremner]] --- -At first I need to thank you for ikiwiki - it is what I was always looking for - coming from a whole bunch of wiki engines, this is the most intelligent and least bloated one. +At first I need to thank you for ikiwiki - it is what I was always looking +for - coming from a whole bunch of wiki engines, this is the most +intelligent and least bloated one. -My question is about the [[plugins/attachment]] plugin in conjunction with [[plugins/filecheck]]: I am using soundmanger2 js-library for having attached media files of all sorts played inline a page. +My question is about the [[plugins/attachment]] plugin in conjunction with +[[plugins/filecheck]]: I am using soundmanger2 js-library for having +attached media files of all sorts played inline a page. -To achieve this soundmanager2 asks for an id inside a ul-tag surrounding the a-tag. I was wondering if the Insert Link button could be provided with a more elegant solution than to have this code snippet to be filled in by hand every time you use it to insert links for attached media files. And in fact there apparently is a way in attachment.pm. +To achieve this soundmanager2 asks for an id inside a ul-tag surrounding +the a-tag. I was wondering if the Insert Link button could be provided with +a more elegant solution than to have this code snippet to be filled in by +hand every time you use it to insert links for attached media files. And in +fact there apparently is a way in attachment.pm. -While I can see that it is not needed for everyone inserting links to attached media files to have ul- and li-tags surrounding the link itself as well as being supplied with an id fill in, for me it would be the most straight forward solution. Pitty is I don't have the time to wrap my head around perl to write a patch myself. Is there any way to have this made an option which can be called via templates? +While I can see that it is not needed for everyone inserting links to +attached media files to have ul- and li-tags surrounding the link itself as +well as being supplied with an id fill in, for me it would be the most +straight forward solution. Pitty is I don't have the time to wrap my head +around perl to write a patch myself. Is there any way to have this made an +option which can be called via templates? -For sure I would like to donate for such a patch as well as I will do it for ikiwiki anyway, because it is such a fine application. +For sure I would like to donate for such a patch as well as I will do it +for ikiwiki anyway, because it is such a fine application. -If you are not familiar with soundmanager2: It is a very straight forward solution to inline mediafiles, using the usual flash as well as html5 solutions (used by soundcloud.com, freesound.org and the like). Worth a look anyway [schillmania.com](http://www.schillmania.com/) +If you are not familiar with soundmanager2: It is a very straight forward +solution to inline mediafiles, using the usual flash as well as html5 +solutions (used by soundcloud.com, freesound.org and the like). Worth a +look anyway [schillmania.com](http://www.schillmania.com/) Boris +> The behavior of "Insert Links" is currently hardcoded to support images +> and has a fallback for other files. What you want is a +> [[todo/generic_insert_links]] that can insert a template directive. +> Then you could make a template that generates the html needed for +> soundmanager2. I've written down a design at +> [[todo/generic_insert_links]]; I am currently very busy and not sure +> when I will get around to writing it, but with it on the todo list +> I shouldn't forget. --[[Joey]] +> +> You could make a [[ikiwiki/directive/template]] for soundmanager2 +> now, and manually insert the template directive for now +> when you want to embed a sound file. Something like this: + + \[[!template id=embed_mp3 file=your.mp3]] + +> Then in templates/embed_mp3.mdwn, something vaguely like this: + + diff --git a/doc/todo/generic_insert_links b/doc/todo/generic_insert_links new file mode 100644 index 000000000..050f32ee7 --- /dev/null +++ b/doc/todo/generic_insert_links @@ -0,0 +1,24 @@ +The attachment plugin's Insert Links button currently only knows +how to insert plain wikilinks and img directives (for images). + +[[wishlist]]: Generalize this, so a plugin can cause arbitrary text +to be inserted for a particular file. --[[Joey]] + +Design: + +Add an insertlinks hook. Each plugin using the hook would be called, +and passed the filename of the attachment. If it knows how to handle +the file type, it returns a the text that should be inserted on the page. +If not, it returns undef, and the next plugin is tried. + +This would mean writing plugins in order to handle links for +special kinds of attachments. To avoid that for simple stuff, +a fallback plugin could run last and look for a template +named like `templates/embed_$extension`, and insert a directive like: + + \[[!template id=embed_vp8 file=my_movie.vp8]] + +Then to handle a new file type, a user could just make a template +that expands to some relevant html. In the example above, +`templates/embed_vp8` could make a html5 video tag, possibly with some +flash fallback code even. -- cgit v1.2.3 From 949a1edac722577d2df9b99428d8fa1e04d37116 Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawndltpDNFSfEZBR_TIcjeDQRkuuyT1e_3o" Date: Sun, 15 Aug 2010 21:39:27 +0000 Subject: --- doc/plugins/filecheck/discussion.mdwn | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'doc/plugins') diff --git a/doc/plugins/filecheck/discussion.mdwn b/doc/plugins/filecheck/discussion.mdwn index 6ef780772..f3f3c4ffd 100644 --- a/doc/plugins/filecheck/discussion.mdwn +++ b/doc/plugins/filecheck/discussion.mdwn @@ -69,3 +69,17 @@ Boris + +>> Thanks a lot - looking forward to [[todo/generic_insert_links]] - I am using the [[ikiwiki/directive/template]] variant also adding a name vaiable, it looks like this and is working fine: + +
    +
  • + +
  • +
+ +>> Calling it: + + \[[!template id=embedmedia.tmpl file=../Tinas_Gonna_Have_A_Baby.mp3 name="Tina's Gonna Have A Baby" ]] + +>> BTW your Flattr button doesn't seem to work properly - or it is Flattr itself that doesn't- clicking it won't let ikiwiki show up on my Dashboard. -- cgit v1.2.3