How to embed only certain lines from a gist?

What you need is this:

http://gist-it.appspot.com/

# Embed the file robertkrimen/gist-it-example/example.js
<script src="http://gist-it.appspot.com/github/robertkrimen/gist-it-example/blob/master/example.js"></script>

# Embed without a footer
<script src="http://gist-it.appspot.com/github/robertkrimen/gist-it-example/blob/master/example.js?footer=0"></script>

# Show only the first and second line
<script src="http://gist-it.appspot.com/github/robertkrimen/gist-it-example/blob/master/example.js?slice=0:1"></script>

Gist API doesn't provide any such way to embed part of a gist. However you can do it yourself with javascript in your end. there is a good library you can use:

https://github.com/kashif-umair/gist-embed/

You can embed parts of a gist with this.

Tags:

Github

Gist