An option to customize the note id
gambhiro opened this issue · 3 comments
May I ask if we could customize how the note id is generated?
Org-roam generates them with org-id-get-create. I couldn't find out how to change this for new md-roam notes, so I have been creating an id manually in the scratch buffer and copying it back to the capture buffer.
In md-roam:
---
title: that's a new note
id: 2023-02-03-070000
aliases: []
---
In org-roam:
:PROPERTIES:
:ID: bd62c1eb-7dfa-4ffa-9329-5454f17c702d
:END:
#+TITLE: that's a new note
#+FILETAGS:
If you are Org version 9.5, you can customize org-id-method
to time stamp.
I do this: org-id-method' is set to 'ts (time stamp)
. And use org-roam-capture-templates
like this:
("p" "personal Markdown" plain ""
:target
(file+head "personal/${id}.md"
"---\ntitle: ${title}\nid: ${id}\ncategory: %^{Category|#reference|#creation|#index|#meeting}\nmodified: <>\n---\n")
:unnarrowed t)
ID is just a plain text, so if you are not on version 9.5, you can use format-time-string
. I think in this case you might like to also add something in capture-finalize hook to call org-id-add-location
for the ID and markdown file.
If this is unclear let me know
Ah brilliant. I didn't realize I can put id: ${id}
in the capture template, I was stuck on thinking in terms of the %
syntax.