silverbullet icon indicating copy to clipboard operation
silverbullet copied to clipboard

Pass page details to registerAttributeExtractor

Open bnason opened this issue 4 months ago • 2 comments

It would be helpful to have the details of the page passed into registerAttributeExtractor. My use case is for extracting a date from the page a task is on to use as a created date instead of having to add that to every task in the page.

bnason avatar Feb 29 '24 20:02 bnason

Before I implement this, let's make sure that this will actually give you want you want. What I could implement is that I pass in either a page name, or with a bit more effort PageMeta information which would include the page name, lastModified date, createdDate, any frontmatter etc. Will that be useful to you, though?

This won't tell you when the task was created, just when the page was created or last modified, and the latter will change every save, and therefore also change for each of your index calls. Indexing indexes everything on a page from scratch, it wipes old data for that page from the index and then calculates the new data. So you won't be able to distinguish "old tasks" from "new tasks".

zefhemel avatar Mar 02 '24 11:03 zefhemel

I was planning on primarily using the date from the name of the page if it includes YYYY-MM-DD and as a backup a date field from frontmatter.

bnason avatar Mar 02 '24 13:03 bnason