Attachment icon (for notes with links to non .md files)

Feature Idea

In the obsidian file browser it would be nice to have a class applied to files that have one or more links to a non .md file (i.e. a file attachment) so that themes could optionally provide an attachment icon for quickly identifying notes with external attachments.

Bonus elements

  • A bonus feature would for the class to identify attachment count. This would allow badge style icon that shows the attachment count of a note.
  • Another bonus might be to add class for attachment file type (e.g. attachment-pdf for pdf files)

Use Case:

The use case for this is to quickly identify notes with attachments, like how emails are generally presented. This would pair nicely with a search feature “has:attachment” and another search syntax for filtering attachment file type (pdf, png, etc.) - some of these advanced search features have already been discussed elsewhere, just highlighting the synergy.

I made this a feature request since this would provide a core piece of info that the themes could handle as they please. But depending on how the plugin api works I could imagine it being a plugin as well. For instance a possible implantation as a plugin would be to auto-add tags to notes when an attachment link is added to the note (e.g. #meta_attachment_pdf, #meta_attachment_png, etc.) then the file browser would only need to show tags next to note names.

4 Likes