cristianvasquez / obsidian-prettify

A markdown prettifier for obsidian
GNU General Public License v3.0
129 stars 12 forks source link

Enhancement: Possible to run everytime a note is closed? #32

Open heliostatic opened 3 years ago

heliostatic commented 3 years ago

I am not familiar with the Plugin API yet, but is it possible to run the prettifier (create or update) every time a note is closed/navigated away from?

rsteenwyk commented 3 years ago

I'm curious about this as well. I really like the date updated metadata, it would be great if I could configure it somehow to always run when the file is modified.

harmtemolder commented 3 years ago

We should be able to do something with

this.registerEvent(this.app.vault.on('closed', () => this.runPrettifier()));

within onload. Not sure about closed though. (See line 2786 onwards in node_modules/obsidian/obsidian.d.ts for other events.) Tinkering with it now.