lynchjames / note-refactor-obsidian

Allows for text selections to be copied (refactored) into new notes and notes to be split into other notes.
MIT License
524 stars 39 forks source link

Unique IDs for refactored notes #64

Open Krammy opened 3 years ago

Krammy commented 3 years ago

First of all, thank you for the great plug-in. It's been incredibly useful.

I would like to be able to get unique IDs for refactored notes, similar to how the Zettelkasten Prefixer core plug-in works.

My prefix in settings is this: {{date:YYYYMMDDHHmm}}.

My workflow at the moment is to map out a bunch of information in a single note, split up the note using headers, and then use the split note by headers command in command palette to split the note by headers into new notes.

The problem with this workflow is that the files that it produces all show the same ID as they're all created at the same time.

One solution would be that for each next note, this command would increment one to the minute counter to prevent duplicate IDs.

Another, more preferred and global solution, would be to generalise this and analyse the Zettelkasten for duplicate IDs as you refactor a note, continually incrementing the note ID by one minute and checking again if one exists until there are no existing files with that ID, ensuring a unique ID every time.

Thank you.

Arthurpmrs commented 3 years ago

Hello. I'm also using this plug-in and it's amazing. Have you tried using unix time as the time stamp? As far as I'm concern it increment as seconds, so it would be difficult to have two extracted notes with the same ID.

Would be like this: {{date:X}}

Sorry if I didn't understand you correctly.

Krammy commented 3 years ago

Thank you for the suggestion, though I'm not interested in having seconds in my ID, especially as that wouldn't work with my workflow anyway when refactoring multiple notes simultaneously.