namilus / denote-menu

View and filter Denote files in a tabulated list
https://www.scss.tcd.ie/~sulimanm/posts/denote-menu.html
GNU General Public License v3.0
53 stars 11 forks source link

Date column should optionally take date from front matter #6

Closed j4kub5 closed 1 year ago

j4kub5 commented 1 year ago

Currently, date (in the 'Date' column) is taken from filename (identifier part). The identifier is supposed to be unchanged. It is sometimes useful to change the date of a note manually (e.g. to adjust time for a meeting note). Would be great to be able to choose whether the date column is populated with dates taken from identifier or from front matter.

Sorry for the "should" in the issue title. I want to be clear, not rude.

namilus commented 1 year ago

Hi @Jack8472,

No need for the apology!

I'm unclear about the workflow you've described. The way I've understood is that you create some meeting notes where initially the timestamp in the front matter and the timestamp in the filename match. Then you go ahead and change one of them, and you'd like to choose which timestamp to display in the date column?

Additionally, when changing the timestamp, why not change both (front matter as well as filename) so that there is no mismatch between timestamps?

j4kub5 commented 1 year ago

Thank you for your reply!

The workflow is:

  1. I create a meeting note for tomorrow meeting with denote-date (setting the date for tomorrow). I start writing what I need to say at the meeting.
  2. The meeting is postponed by one day.
  3. I change the date in my meeting note to reflect the new meeting time.
  4. After this, the date in #+date and date as displayed in the denote-menu column do not match.

Your proposal to change both #+date and the identifier would work, but there are some cons:

  1. Changing the identifier breaks denote links in other notes.
  2. There is no easy way to change the identifier (e.g. chainging it in the front matter and running denote-rename-file-using-front-matter does not update the identifier). Maybe there is an easy way, but I don't know it.

Also, as I understand the concept of an identifier, its purpose is to create unique id for each file. It is not supposed to change. This implies that reliable information about note "time" should be retrived from something easily editable by user. Please correct me if I am wrong about how identifier is supposed to work.

namilus commented 1 year ago

I see what you mean now, thanks for clarifying.

I'm not opposed to the idea, but I'm afraid an implementation won't be easy (or clean). The different denote file types (e.g .org, .md, .txt, and user custom types) each define their own front matter format, and so writing a function that can extract the timestamp from the front matter of an arbitrary denote file would be difficult. Would the functionality only support .org, .md, and .txt files, for which there is a specified front matter format, or would it allow for custom denote file types, and if so, how?

j4kub5 commented 1 year ago

I understand your point. Perhaps it will be easier to write a function to update the identifier (ideally in a safe way). This is beyond the scope of denote-menu I think. Thank you!