I am a bit of an org-roam newb, and I want to get numbered notes, instead of dated. So my first node would be named 1-markov_inequality, etc. How would I set up capture to do that?
As far as I can see, you would need to “code” it by yourself.
Given the title of your example node’s title, I assume you study math and/or can program. Apologies if the style I write does not sound like what you expected as a response to your question. I would appreciate it if you can advise what type of response you would like (I am assuming the style is Okay for those who code).
Here is an outline of an idea I can quickly think of:
- Define a variable “node-count”.
- Initialize it when you load Org-roam first time after launching Emacs (you can use SQL to count the current number of nodes)
- Use the variable in your template as sexp like %node-count (I think)
- Count it up every time you create a new node (you can probably use capture finalization hook, the same one Org-roam uses to add ID to a new file node)
I suggest you will need to be a bit more precise about your requirements. Examples:
-
How do you want to treat deletion of nodes? If you reduce the number, the same number can appear more than once
-
How do you treat headline nodes? Will you only have file nodes? You will probably want to exclude headline nodes from the counting logic. Or include them too?
-
The logic above does not cater to changing of file names; I am assuming you meant file names, not titles of nodes; two different things
Thanks, it’s good to know that it will take some work. I will try to do it when I have some free time.
If you are just needing to sort the files, I would use date-time as prefix (yyyy-mm-dd, etc.) to filenames. That’s how I name them for sorting.