Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a GitHub gist extension #829

Closed
11 tasks
cramforce opened this issue Nov 2, 2015 · 6 comments
Closed
11 tasks

Create a GitHub gist extension #829

cramforce opened this issue Nov 2, 2015 · 6 comments

Comments

@cramforce
Copy link
Member

cramforce commented Nov 2, 2015

Background

The AMP HTML library includes many extended components that bring third-party functionality as first-class components in AMP.

Motivation

We like to introduce a new component to integrate Github gist in AMP. This would allow developers to include their code from Github in their AMP pages.

Implementation strategy

  • create <amp-gist data-src="https://gist.github.com/cramforce/c5d8ae62be229291e421.js"></amp-gist>.
  • It will be very similar to amp-twitter
  • This creates a 3p frame
  • Then creates 3p/github.js also very similar to 3p/twitter.js. The JS loading can be simpler in the initial version (Just insert the script tag)
  • Try to figure out when the document has the final height
  • Then call
context.updateDimensions(
        body./*OK*/offsetWidth,
        body./*OK*/offsetHeight + /* margins */ 20);

Step by step

Once approved, your changes will be merged. ⚡⚡⚡Congrats on making your first contribution to the AMP Project!⚡⚡⚡ You'll be able to see it live across the web soon!

Thanks, and we hope to see more contributions from you soon.

Questions?

If you have questions ask in this issue or on your Pull Request (mentioning @aghassemi) or see the How to get help section of the Getting Started guide.

@niutech
Copy link
Contributor

niutech commented Nov 12, 2015

From what I see, the work has started in https://github.com/jmadler/amphtml/tree/amp-github

@rudygalfi rudygalfi added this to the M1 milestone Jan 30, 2016
@rudygalfi
Copy link
Contributor

@jmadler Can you give an update on the status of this?

@rudygalfi rudygalfi modified the milestones: M2, M1 Jan 30, 2016
@mkhatib
Copy link
Contributor

mkhatib commented Feb 25, 2016

@jmadler have you managed to get this to work?

@rudygalfi rudygalfi modified the milestones: M2, Backlog Mar 4, 2016
@jmadler jmadler removed their assignment Apr 18, 2016
@pbakaus
Copy link
Contributor

pbakaus commented Sep 27, 2016

Quick update, I just learned that you can append ".pibb" to any Gist url, which will render the contents directly in HTML (interestingly, without head but who cares). This makes it viable to use amp-iframe to insert Gists into a page, but we still don't know the resulting height. Thoughts?

@levidurfee
Copy link
Member

levidurfee commented Mar 16, 2017

Hello, is this up for grabs? If so, I would like to give it a shot :)

@pbakaus
Copy link
Contributor

pbakaus commented Mar 16, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants