(no commit message)
[ikiwiki] / doc / todo / generic_insert_links
CommitLineData
52e3f698
JH
1The attachment plugin's Insert Links button currently only knows
2how to insert plain wikilinks and img directives (for images).
3
4[[wishlist]]: Generalize this, so a plugin can cause arbitrary text
5to be inserted for a particular file. --[[Joey]]
6
7Design:
8
9Add an insertlinks hook. Each plugin using the hook would be called,
10and passed the filename of the attachment. If it knows how to handle
11the file type, it returns a the text that should be inserted on the page.
12If not, it returns undef, and the next plugin is tried.
13
14This would mean writing plugins in order to handle links for
15special kinds of attachments. To avoid that for simple stuff,
16a fallback plugin could run last and look for a template
17named like `templates/embed_$extension`, and insert a directive like:
18
19 \[[!template id=embed_vp8 file=my_movie.vp8]]
20
21Then to handle a new file type, a user could just make a template
22that expands to some relevant html. In the example above,
23`templates/embed_vp8` could make a html5 video tag, possibly with some
24flash fallback code even.