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

Will it ever be possible to embed gist snippets in github flavored markdown? #199

Closed
missinglink opened this issue May 3, 2013 · 40 comments
Labels

Comments

@missinglink
Copy link

Will it ever be possible to embed gist snippets in github flavored markdown?

What are the technical issues involved with this, we obviously can't have people injecting random script tags in the page, but there must be another solution?

related: http://stackoverflow.com/questions/11622509/github-how-to-embed-a-gist-into-readme-md

Apologies is this is a duplicate, I assume this has been discussed at some point..

@hlobil
Copy link

hlobil commented Nov 14, 2013

+1

4 similar comments
@natflow
Copy link

natflow commented Dec 3, 2013

👍

@kaero
Copy link

kaero commented Jan 13, 2014

👍

@davereid
Copy link

👍

@c4milo
Copy link

c4milo commented Jan 29, 2014

👍

@c4milo
Copy link

c4milo commented Jan 29, 2014

I would like to be able to embed hackpad pads.

@PureKrome
Copy link

👍👍

@jeffreyroberts
Copy link

This would be absolutely awesome, I currently maintain a list of references to standards, principles, best practices, design patterns, and software development processes that I pass out to new developers, but I also implement all of the above in my framework and I would love to not have to maintain the list in two places....

@rdepena
Copy link

rdepena commented Mar 7, 2014

👍

@missinglink
Copy link
Author

cc/ @shiftkey as discussed at the drink up last night

@PureKrome
Copy link

@missinglink Oh sweet! Pulling in the Big Guns(:tm:) now! Nice :smile_cat:

@schmunk42
Copy link

👍

5 similar comments
@pietrorampini
Copy link

👍

@danielbachhuber
Copy link

👍

@phelma
Copy link

phelma commented Apr 17, 2014

👍

@jsifalda
Copy link

👍

@deigote
Copy link

deigote commented May 19, 2014

👍

@stepthom
Copy link

👍 👍 👍

@felipenmoura
Copy link

👍

@josh
Copy link
Contributor

josh commented May 29, 2014

I don't really see this one happening.

@ysokolovski
Copy link

+1

@shiftkey
Copy link
Member

shiftkey commented Jun 7, 2014

I've been sitting on this for a while since @missinglink was in my ear about this, and I meant to write up some thoughts about it.

What are the technical issues involved with this, we obviously can't have people injecting random script tags in the page, but there must be another solution?

Off the top of my head, there's a number of questions I have about a hypothetical implementation of this:

  • the obvious security risks with injecting arbitrary content - there's no consistent concept of safe_mode with Markdown, so do we need to address that as part of this?
  • what does the implementation of the tag look like?
    • Is it HTML or a new Markdown tag?
    • do you provide a gist id or just a URL?
    • do you have fallback content for parsers which don't understand GHfM?
  • gists can consist of multiple files - you can link to one file with the # placeholder, but what about multiple files? Or do we just embed them all and you're on your own?
  • gists have revisions - what does the syntax look like if you want to display a specific revision?

But I'll leave it up to others who are more involved with the Gist project to make the final decision.

For some context: I experimented with this problem on a project ages ago. I used HTML comment tags to anchor the dynamic content (in this case, code snippets) around documentation. A script would then search for placeholders, and their associated contents, and update them in one fell swoop.

@c4milo
Copy link

c4milo commented Jun 7, 2014

the obvious security risks with injecting arbitrary content - there's no consistent concept of safe_mode with Markdown, so do we need to address that as part of this?

You could try https://developers.google.com/caja/ Although, it may be overkill. They also have a JsHtmlSanitizer script.

what does the implementation of the tag look like?

I would expect it to work just like linking issues through URLs, except that in this case it recognizes it as a Github gist and expands it. Hackpad does currently expand Github gists for example: https://hackpad.com/Look-Ma-a-Github-gist-EuAaGS6VHmd

do you have fallback content for parsers which don't understand GHfM?

Since it is a URL, other parsers would just show the URL I guess.

gists can consist of multiple files - you can link to one file with the # placeholder, but what about multiple files? Or do we just embed them all and you're on your own?

Hackpad seems to embed them all which I think is fine. If I wanted them separated I would create multiple gists.

gists have revisions - what does the syntax look like if you want to display a specific revision?

Last revision would be fine to begin with, users will let you know if they need more than that.

@felipenmoura
Copy link

I agree with all @c4milo said.
As for revisions, it could be interesting to use a simple mark like in jsperf ( /X )
Or even a "#X", or "#!X" in the end of the URL. Although, keeping the last one embeded would already be awesome.
A quick question would be...would it stay up to date?
If a person updates the gist, the embeded gist is supposed to be shown up to date, right?

@avishnyakov
Copy link

👍

3 similar comments
@ixtli
Copy link

ixtli commented Jul 3, 2014

👍

@craighooghiem
Copy link

👍

@radkodinev
Copy link

👍

@elado
Copy link

elado commented Jul 25, 2014

👍

5 similar comments
@samhatoum
Copy link

👍

@inlikealion
Copy link

👍

@phelma
Copy link

phelma commented Jul 30, 2014

👍

@kongchen
Copy link

👍

@keegoid
Copy link

keegoid commented Aug 19, 2014

👍

@charandas
Copy link

👍

@mderazon
Copy link

mderazon commented Sep 3, 2014

👍

2 similar comments
@andrewmallis
Copy link

👍

@mriddle
Copy link

mriddle commented Sep 26, 2014

👍

@github github locked and limited conversation to collaborators Sep 26, 2014
@bkeepers
Copy link
Contributor

Thanks for the request. This gem only handles markup to HTML conversion, but I've logged this feature request with our internal teams.

@bkeepers bkeepers closed this as completed Mar 4, 2015
@bkeepers
Copy link
Contributor

bkeepers commented Mar 4, 2015

This is not a feature that can be implemented by a change to this library, so I closed the issue.

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

No branches or pull requests