Example plugin for new upload type?

Are there any instructions or examples to look at for writing a plugin that allows users to upload a new type of file? Specifically, I’m hoping to write a plugin that lets users upload small-ish 3D files in obj/ply/vtk formats and add lightbox-like capabilities through vtk-js so they can be viewed inline.

Unless I’m missing something, there’s a site setting for that. Just add the file type there.

I think it is the secondary part, which would simply requiring a markdown-it style plugin to interpret links with .obj/ply/vtk to make it show inline.

@pfaffman Thanks! I’ve been able to add the file types.

@cpradio Would following the example of your discourse-plugin-checklist plugin (but replacing “a.attachment” elements with a vtk-js canvas instead of replacing “.chcklst-box” elements with clickable font-awesome icons) be what you had in mind? Searching for the markdown-it plugin was a little confusing… is markdown-it the name of a plugin or is it something that other extensions use? Thanks!

That could be a good start, there is a Gallery related plugin somewhere too that may be a good fit as well.