lostintangent / wikilens

🔎 VS Code extension that provides a Roam/Obsidian-like markdown-based notetaking experience for github.dev and VS Code
https://aka.ms/wikilens
128 stars 8 forks source link

Auto-Refresh #19

Open sotn3m opened 3 years ago

sotn3m commented 3 years ago

... on file renames and content changes could be very useful.

Scenario: I have fixed the header and, as a consequence, I can imagine both "wiki" is updated and the backlinks appear at the bottom of the editor.

By the way, I am very positively surprised how such an early release is feature rich and simple at the same time. Looks awesome already.

lostintangent commented 3 years ago

Hey! The "Wiki" tree should already update when you edit, delete or rename a file. Are you not seeing that?

sotn3m commented 3 years ago

You are correct. I have somewhat assumed no refresh is built-in. Sorry for that.

The "scenario" I have mentioned is probably the only thing. I have lots of pages without a markdown title - obsidian seems to work with filenames as well. I was adding a title to such files and I was not seeing any refresh in "wiki".

lostintangent commented 3 years ago

Ah I see. Out of curiosity: what would you expect if the page doesn't have a markdown title? To make the title a "sentence-cased" version of the file name?

Also, what if the page does have a title, but it differs from the file name? Should the markdown title take precedence?

Regarding your scenario: if you update a page's markdown title, and save it, the new title should be reflected in the "Wiki" tree. If you're not seeing that, then that's a bug I'd need to look into.

sotn3m commented 3 years ago

I was not expecting for the title to be automatically added. I was, however, expecting that the links might/could work regardless whether they point to title or filename.

Regarding the scenario: the way I see it work, wiki is refreshed, the title in the wiki is refreshed, but the backlinks to that title are not.

lostintangent commented 3 years ago

Ah! Is this a dupe of #14? And you're expecting to update backlinks when a page is renamed?

sotn3m commented 3 years ago

It might be, but it probably depends on the implementation :) I was looking at #14 as means to have a command that changes all: file name, title, backlinks, etc. Here, I am really talking about reacting to a save when file name is not changed and the title is changed manually.

sotn3m commented 3 years ago

I have re-read your previous point about title vs file name. From my current perspective, your proposal makes the most sense: if it exists, title supersedes file name. As to the conversion of file name, aren't file names usually much more limited to the available characters than the title within markdown?

With previous comment I was looking mostly from the linking perspective (link can work with both even if we show only one), but I now see the need to implement the "wiki" part first.

lostintangent commented 3 years ago

Ah OK! So you’re primarily looking for backlinks to support either the file name or the title? In the case of the file name, are you currently using file paths? Or just the filename itself? (with or without the “.md” extension)

sotn3m commented 3 years ago

Yes, I was looking for backlinks to support both. Why? The way I see it, Obsidian uses links only to a filename - not to a "H1 header" (# header in markdown) nor to a yaml frontmatter title: (...). I was not doing any extensive research, but the way I see it, supporting both should simplify imports from other software. I have really noticed the problem by accident when I was correcting some of the titles to have proper backlinks in WikiLens. Filename without full path and without extension seems reasonable to me. I believe some software allows for full path when conflicts in names appear, but I am not certain.

Should I create any additional items based on our discussion here? It seems neither "changes to H1 header could update backlinks" nor "allow linking to both" are expressed clearly at the top ;)