Coder Social home page Coder Social logo

samwarnick / obsidian-simple-embeds Goto Github PK

View Code? Open in Web Editor NEW
167.0 167.0 21.0 4.67 MB

A plugin for Obsidian that automatically turns links into embeds.

License: MIT License

TypeScript 81.83% JavaScript 9.82% CSS 8.35%
obsidian-md obsidian-plugin typescript

obsidian-simple-embeds's Introduction

Hi there ๐Ÿ‘‹

obsidian-simple-embeds's People

Contributors

chardinson avatar kinduff avatar nomarcub avatar samwarnick avatar tdresser avatar toddmoy avatar udbhav-s avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

obsidian-simple-embeds's Issues

[FEATURE REQUEST] Archive.org Video Embeds

It would be awesome if this plugin supported video embeds from Archive.org. This can already be done using an iframe in Obsidian, but Simple Embeds is a much cleaner experience!

The URL structure is straight-forward. For a URL like

https://archive.org/details/hopeconf2020/20200725_0900_Opening_Ceremony.mp4

simply replace /details/ with /embed/

https://archive.org/embed/hopeconf2020/20200725_0900_Opening_Ceremony.mp4

to get the embedded view.

(It would be awesome if both forms of the URL were supported, as that would make conversion easier!)


While I don't have any references to audio from Archive.org, this can also be embedded in a similar fashion. For example, the URL

https://archive.org/details/gd82-08-08.sbd-wise.unknown.7690.sbeok.shnf/gd82-08-08d1t01.shn

has an embedded form

https://archive.org/embed/gd82-08-08.sbd-wise.unknown.7690.sbeok.shnf/gd82-08-08d1t01.shn

I assume that the audio embed is also suitable for direct inclusion with an iframe, but don't have any experience with this myself.

Thanks!

Only embed standalone links

Love the idea for this plugin.

It was quite surprising to find standard links, those where portions of a sentence are a hyperlink, turned into embeds. You actually then lose key narrative text.

It would be useful to have a settings flag through which I could choose to only to show embeds of links that stand alone on their own line, and/or maybe URLs that aren't even yet hyperlinked.

Twitter dark themes

Twitter embeds can be dark, so they should follow from Obsidian's theme settings. May be applicable to other sites too.

[Bug] Apple Podcasts

When I try to add Apple podcast to my note I get a gray iframe.
The first one is plugin generated, and second one is iframe from podcasts.apple.com
ie.
<iframe allow="autoplay *; encrypted-media *; fullscreen *; clipboard-write" frameborder="0" height="175" style="width:100%;max-width:660px;overflow:hidden;background:transparent;" sandbox="allow-forms allow-popups allow-same-origin allow-scripts allow-storage-access-by-user-activation allow-top-navigation-by-user-activation" src="https://embed.podcasts.apple.com/dk/podcast/an-abortion-rights-champion-of-the-1970s-on/id1200361736?i=1000568418978"></iframe>

It works fine on mobile version.
Is it because of some changes in obsidian 15.3?

image

Exclude specific links

It would be great to be able to easily exclude specific links from having an embed with a specific markdown syntax

Spotify support

This is what I found through a quick Googling.
Spotify already works for me in iframes in Obsidian.

Generic Link preview with image

I often use obsidian to do online research and gather multiple links from all over the place. To format them in a nicer way for future reference I like to use the Rich Links plugin. However, its buggy for some urls and you have to manually convert them. Here, the workflow of Simple Embeds is much nicer as you can just switch to view mode after finishing the note and all links get converted to a nice preview.
Expcept for the generic URLs. There is a title and some content text, but image. Is it possible to integrate an option to addittionally integrate an image from the related URL or a placeholder image (if none is available), very similar to what rich links does?
Can I do this with CSS-snippets already? If so, how??

EDIT: Oh wait it does work with an image, just not for every URL. In this case, a placeholder image (maybe the websites symbol) would be preferred. This way a clean and homogeneous look can be achieved when multiple links are there. Also an option for the max visible lines in the content text would be nice.

Support for embedding Twitter threads

The embedding of single tweets is great, but there doesn't seem to be a way to render an entire thread. Thoughts?

One option: support for embedding threads a la thread reader.

[Twitter link](https://twitter.com/tannerc/thread/1539248244823404544)

or with an attribute.

[Twitter link|thread](https://twitter.com/tannerc/status/1539248240159334406)

Add setting to opt in to embeds by default

Some people would rather not replace or add embeds by default. With this setting |embed will need to be added to enable an embed. So a link will look like [Descriptive text|embed](https://some.link).

From discussion in #1.

Handle basic links in live preview

Right now all links need to be markdown links, like [Some twitter link](https://twitter.com/user/1234). Would be nice if it handled regular links like it does in the normal preview mode. Can be tricky to parse the note to find these links though.

[Feature request] Markdown format for embedding

![[ is the standard format in Obsidian for embedding files and notes. I think it makes more sens to reuse this syntax instead of embedding every YouTube video into the notes and specifying which ones should be excluded with a [[link|noembed]] parameter.

Support YouTube start time

Normal YouTube links can have a ?start=, &t=, ?t= suffix that should be preserved (and in case of the latter two, turned into ?start=, which is the only one embed accepts).

|noembed text displayed in preview mode

Sorry, me again! ๐Ÿ˜„

A small cosmetic issue...

For the first time today I tried using |noembed - and found it was displayed in preview mode.

Source:

[Reset Pebble watch|noembed](https://www.youtube.com/watch?v=xv_EkeJi1-A)

Result in preview, with Simple Embeds 1.6.2

image

From looking at the code, I suspect this may be the result of the fix for #18 - ff220aa

Plugin seems to disable formatting inside link text

Hello, thank you for a very nice plugin...

I just wanted to report an odd display problem I had, that via bisecting, I tracked down to this plugin.

I am using this markdown for the demo:

[samwarnick/**obsidian-simple-embeds**](https://github.com/samwarnick/obsidian-simple-embeds)

Expected behaviour

With these settings...

  • no plugins
  • with default theme
  • no snippets
  • legacy editor (no live preview)

... the previewed display in Obsidian 0.13.15 is as expected:

image

Actual behaviour

With these settings, however...

  • only Simple Embeds 1.6.1 installed
  • with default theme
  • no snippets
  • legacy editor (no live preview)

... the previewed display in Obsidian 0.13.15 is missing the bold text:

image

In other words, the formatting seems to have been lost.

The behaviour is the same if I turn Live Preview on (I turned it off for the purposes of bug-reporting)

iPadOS: Failed to load plugin simple-embed

For the last few days, I can no longer use simple embeds on my iPad. Trying to activate the plugin always generates the following message: "Failed to load plugin simple-embeds". It used to work well. Still working well on my PC.

[FEATURE REQUEST] PeerTube Embeds

It would be awesome if Simple Embeds could support PeerTube. PeerTube has an embedding API, but the hard part might be figuring out if a URL represents a PeerTube server, since it's a distributed/self-hosted platform.

Currently I embed PeerTube videos directly with iframes; for example, this URL

https://peertube.linuxrocks.online/w/kWfBbYERiN9KWqoLaCdAVk

corresponds to this iframe-suitable embed

https://peertube.linuxrocks.online/videos/embed/a170ccc1-5d49-4517-a5dc-c0f2844c579d

That said, Simple Embeds is a much cleaner solution than iframes!

Option to disable in Source mode

I mostly use live preview, but sometimes source view comes in handy too. However, I'd like that mode to be as bare as possible.
I know this is how something similar was implemented in the favicons plugin, addressing this issue.

Add option to make embeds full width

Right now, most embeds have a max width of 550px. I believe this is the max width of embeds created by the Twitter API, so I made others follow suit. My current thought is to allow users to add |fullwidth or something like that to a link description.

YouTube Shorts Support

I end up finding a lot of good quotes in YouTube Shorts. It would be nice if these links also worked with simple embeds. The embedding works the same it's just the link's regex would be different.

https://youtube.com/shorts/VIDEOID?feature=share

It should probably have its own CSS class because most of the videos are in portrait.

YouTube thumbnail is bad quality

The new YouTube thumbnails since #34 are really low quality / resolution. Here's an embed by the plugin followed by a normal iframe. It's ugly even with a narrow document but especially with the fullwidth option. There should be at least an option to fetch a higher quality thumbnail.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.