Is your feature request related to a problem? Please describe.
When autocompleting link opened with
Foam shows proposition list, where you can find filenames of available documents with additional preview of the content. When position is picked, Foam fills
[] link with shortest possible file identifier like
Foam shows proposition list, where you can find titles of available documents, with additional preview that may (not must) have a path to the document. When position is picked, Foam fills
[] link with file identifier aliased with file title like
[[file1|The title found in the file]] for
When trying to use Foam to build so called Second Brain using Zettelkasten method I can see this problem. The metod says that each file/note should have unique identifier/filename that should be not mutable after note creation. The easiest approach to achieve this is to use for example timestamp as a filename. But this brings us to the problem described above, when you have several files named like:
and you try to create a link to another note, the only thing you see is this list of numbers. When you want to find particular note you have to check previews.
It would be very helpful instead of seeing this list of filenames, to see list of note titles extracted by for example regex
^# .*$ and presented like this:
Title1 - 20210511022607.md
Some long title - 20210512085325.md
Other title - 20210515161743.md
Another title - 20210511124221.md
Title over 9000 - 20210521150143.md
Filenames may or may not be presented on the list (it may be a part of preview), but most important, the title of the note should be searchable. And after picking the note Foam should fill the link with the filename aliased with the title like this:
[[20210512085325|Some long title]].
This new approach also should link with some refactoring. When changing title of the note, all references (aliases in links) should also change (option for that). In this approach the note filename is constant so we don't have to be concerned about filename, link change.
Update: Also, there there should be a setting that enforce new file filename to particular format, so no matter which way the file is created (daily note, placeholder click) the filename should always be the same.
Describe the solution you'd like
Mostly described in the main description.
How would I do this?
Add three settings:
Link autocompletion method <drop-box>: (filename|note title)
Note title regex <string>: default(^# .*$)
Change alias on note title change <bool>
New file name format <string>: - something like Daily Note file format (update)
And fill autocompletion box with appropriate content.
Describe alternatives you've considered
The idea is coming from Zettelkaster method:
- I have checked how Obsidian is doing it. Obsidian has a json database, when it connects physical filename, note title and generated uuid as one entity, and fills links with note title. Having this DB application knows how to react to the changes. I think this is one of the best solutions to this problem, but it may be an overkill for what I would want to achieve.
- the main problem on achieving this is to somehow ensure filenames uniqueness also keeping the autocomplete list readable. It can be also done by naming the file as a sum of NoteTitle and timestamp like
Another_title-20210511124221.md. In the list one can see some descriptive text, but link created from this is simply
[[Another_title-20210511124221.md]] that have to be manually changed to
[[Another_title-20210511124221.md|Another title]], and also there is no synchronization when the note changes title. In that case one must rename the file, and manually follow all references to change the alias (or most probably use sed for this).
Screenshots or Videos
enhancement help wanted good first issue foam-vscode