joerncodes / obsidian-expiring-notes

Expiring Notes is a plugin for Obsidian, enabling you to automatically delete or archive notes after a pre-set date.
20 stars 1 forks source link

Expiring Notes

GitHub release (latest SemVer) GitHub All Releases


Important note: This plugin is still very much in beta. There are still bugs I'm trying to work out, so before we go live in the Community Plugin repository, I'd be delighted if you could report any bugs you find. Thank you!


An Obsidian plugin to automatically delete or archive notes that have "expired". With this, you can give your notes a "best by" date and make them disappear as soon as they're obsolete, keeping your vault clean and uncluttered.

Example for those ephemeral notes include:

Installation

As this plugin is currently in early development, you can use BRAT to install it. Use the path joerncodes/obsidian-expiring-notes.

If you're interested in helping to make Expiring Notes a finished product, please see Contributing.

How to make a note expire

To mark a note to expire in the future, this plugin uses a predefined frontmatter key like so:

expires: 2021-01-01

In this example, this note will automatically be either archived or deleted after January 1st, 2021.

You can either write the frontmatter yourself or use the Set Expiry Date command.

Archive / Delete

Expiring Notes has two different modes of operation: delete and archive.

If a note gets deleted, it vanishes from your vault forever - there is no undo. Please use with appropriate caution.

If a note is archived, it gets moved to a predefined archive folder (you can customize the path in settings). Please note that if a file with the same name already exists in the archive, it will get overwritten.

Commands

Set Expiry Date

Use this command to set or modify the expiry date of the currently opened note. You can provide the date either in your chosen date format (see Settings), or using natural date parsing. Some examples include:

Check for expired notes

Scan your vault for expired notes and then either delete or archive them, depending on the behavior you set in your Settings.

Settings

Frontmatter key
This is the key you use to provide an expiry date. The default is expires.
Date format
Used to specify the date format you want to write your expiry dates in. Visit momentjs.com for a list of possible date tokens.
Check for expired notes at startup
If this is enabled, Expiring Notes will collect all expired notes when you start Obsidian.
Enable confirm dialogue
If this is enabled, Expiring Notes will ask you if the expired notes it found should be archived/deleted now.
Behavior
Choose if your notes should be deleted (this has no undo) or moved to a predefined archive folder. Please note that files with the same name will overwrite older files in your archive folder.
Archive folder path
Provide the folder path for your archive (relative to your Obsidian vault root).

Changelog

You can find the changelog here.

Contributing

I'm hoping to make Expiring Notes as awesome as possible, and I need your help to do it. Any issue opened here on GitHub is appreciated, whether it be a bug or a feature request.

If you want to take the time to do a PR, those are welcomed with open arms.