Seraphli / obsidian-link-embed

This plugin allow you to convert URLs in your notes into embeded previews.
MIT License
137 stars 12 forks source link

feature: auto embed all links #6

Closed ZhymabekRoman closed 2 years ago

ZhymabekRoman commented 2 years ago

Hello, thank you for the plugin. Is it possible to make it so that all links are automatically made in embed?

Seraphli commented 2 years ago

I didn't see such functionality in other plugins. I don't know whether it is possible to hook the action of pasting links in Obsidian. If you can provide an example, I can try to implement this feature.

ZhymabekRoman commented 2 years ago

Probably something like this - https://github.com/samwarnick/obsidian-simple-embeds

Seraphli commented 2 years ago

The plugin just changes the preview of the link. It didn't change the way Obisidian handles when the user pastes a link.

Seraphli commented 2 years ago

I guess you want the feature that Notion has, right?

ZhymabekRoman commented 2 years ago

I guess you want the feature that Notion has, right?

Yeah

ZhymabekRoman commented 2 years ago

In Obsidian is it possible to implement the same using this plugin or through other plugin?

Seraphli commented 2 years ago

I think there might be a way to implement this feature. But the thing is Obsidian didn't provide any sophisticated example to demonstrate their APIs, nor any detailed Offical document about their APIs. It's hard for me to find the right solution in this situation. If there is an example of this, it will save a lot of time.

ZhymabekRoman commented 2 years ago

It seems to me it is possible to implement this functionality as a markdown block. See this - https://github.com/MSzturc/obsidian-better-pdf-plugin

ZhymabekRoman commented 2 years ago

If you need any help (to test, for example) - just ping me

Seraphli commented 2 years ago

This example is just like the last one. It only changes the preview look of these links. 😂

Seraphli commented 2 years ago

I was checking this plugin. I don't know if EditorSuggestion is the right way to do this. I might have to check more plugins for references. https://github.com/argenos/nldates-obsidian/blob/master/src/suggest/date-suggest.ts

Seraphli commented 2 years ago

Check out new 1.4.0 release

ZhymabekRoman commented 2 years ago

Thank you very much!

esthor commented 2 years ago

This is great! Is it possible to avoid the popup altogether and just "whenever I paste a link, default it to embedded"?

esthor commented 2 years ago

..err, actually, if you could just switch around the order of the 2 popup items, that would actually be ideal. So, the flow is like:

  1. paste link
  2. link-embed popup comes up
  3. Create Embed is first selected option (instead of Dismiss)

That way, I can just press "return/enter" instead of down arrow and enter....yes, I'm lazy. 😝

esthor commented 2 years ago

I created a PR: https://github.com/Seraphli/obsidian-link-embed/pull/8