Make WordPress Core

Opened 7 years ago

Closed 3 years ago

#41206 closed enhancement (maybelater)

Add embed handler for GitHub gists

Reported by: swissspidy's profile swissspidy Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Embeds Keywords: has-patch
Focuses: Cc:

Description

Gutenberg currently explores adding adding a new block for embedding gists from GitHub (gist.github.com). See: https://github.com/WordPress/gutenberg/issues/1567.

Although Gist supports oEmbed, it only returns raw HTML with code excerpts. There's a superior JS method for embeds, which is also shown when viewing a Gist in the browser. Jetpack supports this method as well.

If Gutenberg wants to add a new block for gists, it should definitely be supported natively by core.

See attached patch as a PoC

Attachments (1)

41206.diff (1.8 KB) - added by swissspidy 7 years ago.

Download all attachments as: .zip

Change History (13)

@swissspidy
7 years ago

#1 @tfrommen
7 years ago

I'm +1 for this, and actually wondered just yesterday why it isn't supported by Core so far and when it might be. :)

However, I don't understand the .json.js thing. Why create URLs for JSON files and then replace the ending anyway? Is there some edge case that I just don't see, or why can't we create URLs for .js files in the first place?

#2 @swissspidy
7 years ago

Probably just a leftover from when I copiedsome code from Jetpack for the patch.

#3 @westonruter
7 years ago

Yeah, also the str_replace( 'json', 'js', $url ) bit seems a bit brittle. Like I should think it should target the specific query param or path segment to replace.

#4 @peterwilsoncc
7 years ago

Going through the checklist for the sake of completeness.

Is the service is popular enough for core developers to have heard of it before? Is it “mainstream?”
Yes, it is mainstream. Core developers have heard of it.

If similar services are already supported, how does this service compare in terms of size, features, and backing?
No similar service supported.

Does this service have a large following on Twitter, Facebook, or other social media? Is its Twitter account verified?
Verified Twitter account with 1.5 million followers.
Verified Facebook account with 110K likes.

Is its oEmbed endpoint clearly established and properly documented? (Sometimes, they are just a developer’s pet project that may not be supported.)
No.

Does the oEmbed endpoint work with WordPress’ oEmbed auto-discovery? If not, could it be made to work with additional HTML tags or attributes being whitelisted?
No and no.

Were Github to add oembed headers, it could be made to work with the the addition of table HTML tags to the whitelisted elements. I don't have any desire to whitelist table elements.

Does the service make an effort to build relationships with developers, such as through robust APIs?
Yes

How old is the service?
9 years old.

Does it have a well-established Wikipedia article? (Seriously.)
Sure does.

Has anyone written a WordPress plugin that leverages the service in some way, whether adding it as an oEmbed provider, creating a shortcode, or leveraging other APIs of the service? Do these plugins have any noticeable adoption or traction that would indicate usage and demand?
Numerous plugins with a variety of install quantities.

Is the provider frequently proposed?
Not really, although support is in Jetpack so it suggests a strong demand.

#5 follow-up: @peterwilsoncc
7 years ago

@swissspidy,

The low quality documentation and lack of oembed header bother me a bit. It suggests hobby project without wide support.

Have you contacted them with a feature request to add the headers? I'm happy to do so and refer them to this ticket if you haven't.

#6 @marsjaninzmarsa
7 years ago

@peterwilsoncc,

The low quality documentation and lack of oembed header bother me a bit. It suggests hobby project without wide support.

GitHub

hobby project

Lel.

Have you contacted them with a feature request to add the headers? I'm happy to do so and refer them to this ticket if you haven't.

I've did:

From: Kuba Niewiarowski <marsjaninzmarsa@…>
To: support@…
Topic: oEmbed provider for Gist, please?

It could be helpful for WordPress folks:
https://github.com/WordPress/gutenberg/issues/1567

From: Nick Cannariato (GitHub Staff) <support@…>
To: Kuba Niewiarowski <marsjaninzmarsa@…>


Hi Kuba,

Thanks for writing in and pointing us to that issue. I can't make any promises, but I'll pass this on to the team for their consideration.

#7 in reply to: ↑ 5 @jorbin
7 years ago

Replying to peterwilsoncc:

@swissspidy,

The low quality documentation and lack of oembed header bother me a bit. It suggests hobby project without wide support.

Have you contacted them with a feature request to add the headers? I'm happy to do so and refer them to this ticket if you haven't.

@benbalter may be able to help identify people on the github side that could help here.

#8 @paaljoachim
4 years ago

How can we get movement on this ticket?
Having a native way to embed gists would be very helpful for many.

#9 @peterwilsoncc
4 years ago

@paaljoachim

The ticket remains blocked at the GitHub end as gists don't support the oembed protocol, I'm also unable to find documentation via a quick Google search.

I missed @jorbin's comment in 2017, I've just messaged Ben Balter via Slack to ask about contacts at GitHub to get oembed supported on their end.

#10 @paaljoachim
4 years ago

Hey @peterwilsoncc

I have also e-mailed Github support and asked them to take a closer look at this trac ticket.

Thanks for picking up this matter Peter!

#11 @desrosj
3 years ago

Just wanted to check if anyone had heard from GitHub on this. Personally, I'd love for this to be added.

#12 @peterwilsoncc
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to maybelater
  • Status changed from new to closed

@desrosj it seems the answer to your question is no.

I'm going to close this off as maybelater in the hope a documented oEmbed endpoint gets added to Gists sometime in the next five years.

Note: See TracTickets for help on using tickets.