Coder Social home page Coder Social logo

sumuyzzz / obsidian-simple-embeds Goto Github PK

View Code? Open in Web Editor NEW

This project forked from samwarnick/obsidian-simple-embeds

1.0 0.0 0.0 4.61 MB

A plugin for Obsidian that automatically turns links into embeds.

License: MIT License

JavaScript 3.07% TypeScript 92.14% CSS 4.78%

obsidian-simple-embeds's Introduction

Simple Embeds

This Obsidian plugin will turn Twitter and YouTube links into embeds when the file is previewed, without changing the contents of your file. Even works when hovering over internal links.

Just add links like you normally would:

[Twitter link](https://twitter.com/johnvoorhees/status/1437735225086316548?s=21)
[YouTube link](https://youtu.be/C4sAUc_ZGMY)

If you would like to disable a particular link, add |noembed to the link text. For example:

[Twitter link|noembed](https://twitter.com/johnvoorhees/status/1437735225086316548?s=21)

By default, most embeds have a max width of 550px (the max width of Twitter embeds). To make an embed full width1, add |fullwidth to the link text. For example:

[YouTube link|fullwidth](https://www.youtube.com/watch?v=aqafn8kFDyY)

Supported links

  • Apple Music2
  • Apple Podcasts
  • Apple TV2
  • CodePen
  • Flat.io
  • Github Gists
  • Instagram
  • Noteflight
  • Twitter
  • YouTube

Styling

Each embed is wrapped in a container with the class of .embed-container and a class unique to each embed type:

Embed Class
Apple Music .apple-music
Apple Podcasts .apple-podcasts
Apple TV .apple-tv
CodePen .codepen
Flat.io .flat_io
GitHub Gists .github_gist
Instagram .instagram
Noteflight .noteflight
Twitter .twitter
YouTube .youtube

You can use these in your own CSS snippets. For example, if you would like to make all YouTube embeds full width, you could add the following:

.embed-container.youtube {
    max-width: 100%;
} 

Or if you want to center all Twitter embeds:

.embed-container.twitter {
    margin: 0 auto;
}

Screenshots

Simple Embeds demo

Demo

Screenshot of embeds in iOS app

iOS app

Screenshot of embeds in Android app

Android app

Footnotes

  1. Many themes set a max width on the preview area, often around 750px. Embeds will not be wider than your theme allows.

  2. Partial support. Some known issues exist. 2

obsidian-simple-embeds's People

Contributors

kinduff avatar samwarnick avatar tdresser avatar

Stargazers

 avatar

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.