Skip to content

Commit

Permalink
Merge branch 'chore/update_readme' of github.com:kashif-umair/gist-em…
Browse files Browse the repository at this point in the history
…bed into chore/update_readme
  • Loading branch information
kashif-umair committed Feb 1, 2013
2 parents 0439bdc + 08c16c1 commit 4015548
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions README.md
@@ -1,20 +1,16 @@
##How to use gist-embed to spice up code snippets on your blog

### Include jQuery:
### Include jQuery and gist-embed:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

### Include gist-embed:
You should include them in your HEAD tag for better performance

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="https://github.com/kashif-umair/gist-embed/raw/master/gist-embed.js"></script>

#### You should include them in your HEAD tag for better performance

### Add a code element to your page with an id attribute in the following format:

"gist-<gist-id>"
e.g.:
### To embed the whole gist you should put this code element in you body where ever you want it to be displayed.
### To embed the whole gist you should put this code element in your body where ever you want it to be displayed.
<code id="gist-4672365"></code>
### To embed a single file from gist, add the data-file attribute to your code element like this.
<code id="gist-4672365" data-file="2.java"></code>
Expand All @@ -27,8 +23,9 @@

This will embed line numbers 2,3,4,5,10,11,12,13,14,11,20 in the same order. If lines are duplicated then they will be duplicated in code too.

#### if you are embedding multiple lines then make sure about following points.
#### If you are embedding multiple lines then make sure about following points.

- You can put a range like "2-5", or single line numbers separated with commas like "11,20", or mix of both like "2-5,11,10-14,20"
- Spaces are not allowed in data-line value

##### You can put a range like "2-5", or single line numbers separated with commas like "11,20", or mix of both like "2-5,11,10-14,20"
##### Spaces are not allowed in data-line value
#### Follow the above instructions to avoid getting any undesired results.

0 comments on commit 4015548

Please sign in to comment.