-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FeatReq: Autocomplete links with notes titles, not filenames #1038
Comments
Thanks for reporting this @XobSod, I think it's a great idea |
@riccardoferretti thank you ;) I would code this myself, but unfortunately I am not TS developer I am finding it hard to understand what is happening there and where to start :D |
And I accidentally closed it -.- |
There are several elements to this issue, that I believe have different level of both complexity and usage.
Regarding the solution, I am trying to keep Foam at simple as possible, so I would rather not fill it with lots of specific options.
Another option would be to treat titles as aliases, which would accomplish everything you are asking for (except the refactoring support), which show up in the list of autocompletion items, and are automatically used as label in the link (
So, still figuring out what the best approach is, would love to hear comments, especially from people using Zettelkasten |
The reason why that is not possible atm is because VS Code variables cannot be expanded outside of a document, otherwise in Foam we want to allow snippet variables to be used also in the You can upvote microsoft/vscode#155868 to push for this change Once that is achieved in the best case you should just need the
uses
select
uses
uses Thanks for your diffs, I am working on something along those lines :) |
Is your feature request related to a problem? Please describe.
When autocompleting link opened with
[[
:Current behavior:
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[[file1]]
forfile1.md
.Expected behavior:
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]]
forfile1.md
.Motivation:
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: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:
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
No response
The text was updated successfully, but these errors were encountered: