Giter VIP home page Giter VIP logo

quarto-social-embeds's Introduction

Quarto social embeds

A Quarto extension to embed content from across the web into a quarto-rendered html document using a shortcode.

Currently includes shortcodes for the following:

  • GitHub gists
  • Loom
  • Twitter
  • Vimeo
  • Youtube
  • Mastodon

Installation

Install the extension with:

quarto install extension sellorm/quarto-social-embeds

Usage

GitHub gists

Embed a gist using {{< gist USERNAME GIST_ID >}}. Both USERNAME and GIST_ID can be extracted from the gist URL. For instance, in this URL https://gist.github.com/sellorm/20525aff669acafb975b7495b8f2066e the username is sellorm and the ID is 20525aff669acafb975b7495b8f2066e, giving us:

{{< gist sellorm 20525aff669acafb975b7495b8f2066e >}}

See example.qmd for a working example.

Loom

To embed a Loom video in your HTML document use this shortcode:

{{< loom <VIDEO_ID> >}}

Where <VIDEO_ID> is the loom video ID. For example:

{{< loom 8619b03224f74282b6d56cbedbcd3fc6 >}}

Which renders like this:

{{< loom 8619b03224f74282b6d56cbedbcd3fc6 >}}

You can get the VIDEO ID from for the URL of the video. For instance, in the URL https://www.loom.com/share/8619b03224f74282b6d56cbedbcd3fc6 the video ID is 8619b03224f74282b6d56cbedbcd3fc6.

Twitter

To embed a Tweet into your Quarto html document you can use the shortcode like this:

{{< tweet <username> <id> >}}

or

{{< tweet user=<username> id=<id> >}}

This second option is provided for compatibility with Hugo.

For example:

{{< tweet sellorm 1555267341327503367 >}}

or

{{< tweet user=sellorm id=1555267341327503367 >}}

You can obtain the username and status id of a tweet by clicking the "share tweet" button and choosing "copy URL".

This will give you a URL like this one: https://twitter.com/sellorm/status/1555267341327503367?s=21&t=M0M4IA_KW-zMY1rb2XOWZQ. The "user" is the section between twitter.com/ and /status. The status "id" is everything between status/ and ? or the end of the URL, whichever comes first.

See example.qmd for a full example.

Youtube

To embed a Youtube video into your Quarto html document you can use the shortcode like this:

{{< youtube VIDEO_ID >}}

Where VIDEO_ID is the youtube video ID. For example:

{{< youtube zk9zHqXm6m0 >}}

You can obtain the video ID by inspecting Youtube's URLs.

For instance, in this URL, https://www.youtube.com/watch?v=zk9zHqXm6m0 the video ID is the part after v= in the URL.

See example.qmd for a working example.

Vimeo

To embed a Vimo video in your HTML document use this shortcode, `{{< vimeo VIDEO_ID >}}

Where VIDEO_ID is the vimeo video ID. For example:

{{< vimeo 22439234 >}}

You can get the VIDEO ID from for the URL of the video. For instance, in the URL https://vimeo.com/channels/top/22439234 the video ID is 22439234.

See example.qmd for a working example.

Mastodon

To embed a post from a mastodon instance in yout HTM document use this shortcode, {{< mastodon status_url>}}, A status URL looks like this https://mastodon.social/@sellorm/109376707453406631

{{< mastodon https://mastodon.social/@sellorm/109376707453406631>}}

See example.qmd for a working example.

quarto-social-embeds's People

Contributors

aariq avatar ikashnitsky avatar schochastics avatar sellorm 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

Watchers

 avatar  avatar  avatar

quarto-social-embeds's Issues

twitter documentation improvements

When there is an error with embedding a tweet, it's currently very difficult to understand why.

The Twitter service that backs this feature is not a "proper" API and so is not particularly helpful at detecting errors.

Improve the documentation to cover cases where there is an error and provide some basic debugging guidance.

See also, #2

Mastodon don't show up

Hey everyone,

I found your quarto extension and I love it. However, mastodon embedding didn't work for me in presentations. From mastodon.lua, I simple deleted height:0 in the first <div>, then mastodon-toots showed up in both formats. Additionally, I deleted the large padding and the fixed height in iframe.

All the best
Phil

adding part (file) of entire gist

thanks for this extension!

It seems it is only possible to add the entire gist, however there are gists with multiple files in which case it would be nice to have the ability to add files individually.

e.g. this works (adding both included files)
{{< gist wiesehahn 6b6c215c227341f4faab03ff96fa7f1b >}}

but this does not work (adding only one file)
{{< gist wiesehahn 6b6c215c227341f4faab03ff96fa7f1b#file-lidar_availability_germany_table-md >}}

Is it already possible somehow or would it be possible to add this functionality?

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.