A mish-mash of initial thoughts before rashly writing any code:
I suppose the "snippet" idea overlaps with the Mahara concept of an artefact, or a Google widget, or similar. At the end of that road lies a new module (something akin to mod/url but that displays more like mod/label) and some tweakage and testing of TinyMCE to correctly handle in-line display of a snippet (or at least, a place-holder box while editing?) in general Moodle content.
I'm thinking that at least as a first step, a function that returns a <div> with whatever is appropriate for the specific repository, separate from the get_url() and get_file() so that existing functionality is unaffected. I'm struggling to find an appropriate name for the function, but something like get_link_snippet() or get_embedded_link().
After some discussion here, perhaps this is more than one use case:
1. For a Koha library book, a document link from Fez or Alfresco, an image from Flickr: we want just a small thumbnail of the object, and the author/title information or even a properly formatted bibliographic citation, which links to the repository object or page.
2. For Youtube, Flickr or Picasa, we want the image itself, or the embedded video, directly in-line in the Moodle content.
Use case 2 overlaps with the mediaplugin filter. However perhaps it is better to deal with AV and embedded players at the repository level, rather than in separate parts of the codebase as it is now. It seems easy to argue this - updates to the way Youtube links get handled in HTML should be in the Youtube repository plugin, and not in a separate filter that also processes other links. Additionally, using a regex in the filter to detect Youtube links in arbitrary content is less robust than having the repository API handle it; especially considering we could put an instance ID and repository plugin type in the div class/ID attributes and control output accordingly with CSS.
Comments and thoughts?