guopenghui / obsidian-quiet-outline

Improving experience of outline in Obsidian
MIT License
295 stars 17 forks source link

[FR] Allow opening external links from Quiet Outline #96

Open msayao-nr opened 1 year ago

msayao-nr commented 1 year ago

Summary

I would like to be able to click external links in the Quiet Outline box so that Obsidian opens the link with its default application instead of jumping to that header in the file. This feature could be a setting to hold a modifier key on the keyboard while clicking on the external link in the Quiet Outline so that the external link opens in the default application.

Reproduce

Example

In this example, External Link is just a Markdown formatted link of:

Clicking on either heading in the Quiet Outline box jumps me to the header in the file (highlighted in yellow).

Feature request

Please add functionality to give users the option to open these links externally or jump to that header in the file.

Thanks!

msayao-nr commented 1 year ago

I see that in the plugin that there is code for jump:

https://github.com/guopenghui/obsidian-quiet-outline/blob/caf63c43db27b5a8a30bf2977327906d03382e1f/src/Outline.vue#L368

I don't mind trying to figure out this functionality, but I'm unsure how to open external links with the default app in Obsidian.

Is this the method for opening links externally with the obsidian-api?

https://github.com/obsidianmd/obsidian-api/blob/38dd22168d2925086371bfc59e36fd9121527a39/obsidian.d.ts#L2761

guopenghui commented 1 year ago

This jump function is used to "jump" between headings.

To open external link, you need to change parser.ts file. Opening external link in browser used to be the default behavior and was changed by code below: https://github.com/guopenghui/obsidian-quiet-outline/blob/caf63c43db27b5a8a30bf2977327906d03382e1f/src/parser.ts#L110-L115

I think opening browser by click heading will cause more accidental opration rather than convenience.