From 2c94420c34b034498a895b6cd83dbadec979487a Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sun, 2 Jan 2011 23:08:26 +0100 Subject: generic insert links: it's a Markdown file (cherry picked from commit 139c050ca48c2fe7bdcd4ea22623739cbb25ceda) --- doc/todo/generic_insert_links | 24 ------------------------ doc/todo/generic_insert_links.mdwn | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 24 deletions(-) delete mode 100644 doc/todo/generic_insert_links create mode 100644 doc/todo/generic_insert_links.mdwn (limited to 'doc/todo') diff --git a/doc/todo/generic_insert_links b/doc/todo/generic_insert_links deleted file mode 100644 index 050f32ee7..000000000 --- a/doc/todo/generic_insert_links +++ /dev/null @@ -1,24 +0,0 @@ -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. diff --git a/doc/todo/generic_insert_links.mdwn b/doc/todo/generic_insert_links.mdwn new file mode 100644 index 000000000..050f32ee7 --- /dev/null +++ b/doc/todo/generic_insert_links.mdwn @@ -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