obsidian-advanced-uri icon indicating copy to clipboard operation
obsidian-advanced-uri copied to clipboard

[FR] add an option to include the encoded `file` in the URL

Open huyz opened this issue 3 years ago • 2 comments

For human-friendly URLs, it would be nice if the file= part of the built-in Obsidian URL were also appended to this plugin's advanced URI. That way when we run into this URL in the wild, we can tell at a glance what it's about. (Similar purpose as URL slugs)

huyz avatar Oct 27 '22 14:10 huyz

I don't understand the benefit of including an file parameter if it's not used. What do you mean with:

when we run into this URL in the wild, we can tell at a glance what it's about.

Vinzent03 avatar Oct 27 '22 15:10 Vinzent03

So when you see a URL, you know what it's about. Maybe you have the wrong one? Maybe you need to move URLs around. Maybe you're including several, and how can you distinguish them?

You remember why slugs became a thing in URLs? https://en.wikipedia.org/wiki/Clean_URL

huyz avatar Oct 27 '22 16:10 huyz

But you just want to make the url longer by adding a redundant parameter. This improves nothing.

Vinzent03 avatar Nov 08 '22 11:11 Vinzent03

Well, it's not for everyone, which is why it should be an option. But clearly some people like human-readable URLs. Maybe, you like insert URLs like https://stackoverflow.com/q/44558955/161972 in your notes or code comments, but I always expand them to https://stackoverflow.com/questions/44558955/vscode-normal-word-completion because that's more user-friendly: I get a hint about whether I want to click on the URL or not just by looking at the URL, saving me time. How is that "nothing"?

In any case, it's clear you don't like it, which is fine.

huyz avatar Nov 08 '22 14:11 huyz

But the uri already has the filepath parameter. The file parameter would have the same value? I think we talk past each other.

Vinzent03 avatar Nov 08 '22 14:11 Vinzent03

The filepath is there if I don't turn on UID in the options. The problem with filepath is of course that it's brittle if I rename a note or move it to another folder. That's the benefit of UID: it's permanent. So I have UID turned on.

But then I wanted my cake and eat it too:

  1. uid= for computer consumption to be used by your plugin to find the note
  2. and something for human consumption:file= or title= or #title= at the end of the URL for when I'm actually reading the URL. Your plugin would just ignore that.

huyz avatar Nov 08 '22 16:11 huyz

Sorry, I think the confusion was that I forgot that I had enabled the UID option long ago. I thought that everyone had UID on by default. My bad, I should have been clearer.

huyz avatar Nov 08 '22 16:11 huyz

Ah now I understand your issue. I always forget the uid option. Will think about a solution.

Vinzent03 avatar Nov 08 '22 16:11 Vinzent03

There is now a new setting, adding the filepath parameter.

Vinzent03 avatar Nov 23 '22 09:11 Vinzent03

@Vinzent03 Thanks so much!

huyz avatar Nov 23 '22 09:11 huyz