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