weichenw / obsidian-hypothesis-plugin

An Obsidian.md plugin that syncs highlights from Hypothesis.
MIT License
235 stars 20 forks source link

[Feature Request] Template should allow us to customize the frontmatter #46

Open huyz opened 2 years ago

huyz commented 2 years ago

My notes usually have created and updated fields in the frontmatter as part of the core Templates (which are then kept up to date by obsidian-linter).

It would be nice if the template setting actually included the current frontmatter that's injected by this plugin, so that I can add my own fields (also want to add tags:).

It would be even nicer too if the updated date could be filled in to be the most recent date of all the highlights/annotations that are synced. As for the created date, maybe it could be set to the oldest date.

boehs commented 2 years ago

Hi Huy,

Frontmatter is integral to the functionality obsidian-hypothesis, and implementing it in a non dangerous way will require deliberation. Are you ok with:

  1. Keeping the doc_type and url frontmatter? It would be much much harder to ditch those
  2. A very rudimentary implementation, you would be writing json like a caveman, no yaml for you!

Still, with those clauses this is absolutely possible and I would be happy to implement it

boehs commented 2 years ago

Actually I don't care about your opinion. Frontmatter here we come!!!!!! 😜

huyz commented 2 years ago

@boehs At first glance, sounds good to me. Any first iteration is a good idea.

fncll commented 2 years ago

Would this allow me to create a template such that the date the page of annotations was created was added to the metadata and not changed/replaced upon subsequent updates? This is what I would like to do in order to automate pulling in "things read on Date X" based on that being that initial date.

dbobak commented 1 year ago

Any progress with the possibility to use frontmatter in template? I'd love to have it!

datavistics commented 1 year ago

@boehs , is it possible to get the date (of the first annotation and/or the last update) at the article level in the front matter?

lidorcg commented 1 year ago

+1 It's the only thing that keeps me from using this plugin.

datavistics commented 1 year ago

@weichenw any chance you can take a look? 🙏