/gitty

A simple, lightweight jQuery plugin used to display a Github user's repositories.

Primary LanguageJavaScriptMIT LicenseMIT

#Gitty

A simple, lightweight jQuery plugin used to display a Github user's repositories.

See a demo

##Instructions

Include jQuery and the plugin in the head or footer of your page.

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    
<script src="/js/plugins/gitty.js"></script>

Create a list where the repositories will display.

<ul class="repositories"></ul>

Initialize the plugin targeting the class, ID or element you've created.

$('.repositories').gitty();

####Options

username: string
A string that defines the Github username of the user you wish to retrieve repositories from (default: null).

type: "all / owner / public / private / member"
A string that defines the type of repositories to be retrieved (default: "all").

sort: "created / updated / pushed / full_name"
A string that defines the how the repositories should be sorted (default: "full_name").

direction: "asc/ desc"
A string that defines the direction the repositories should be listed in (default: "asc").

limit: 5
An integer that defines the number of repositories to display (default: null).

language: boolean
A boolean that indicates whether or not the language of each repository should be displayed (default: true).

success: function()
A callback function that is triggered after the request, if the request is successful.

error: function()
A callback function that is triggered after the request, if the request is fails.

#####Example:

$(function() {

	$('.repositories').gitty({
		username: 'michaelynch'
		type: 'member',
		sort: 'pushed',
		direction: 'desc',
		limit: 10,
		language: false
	});
	

#####Example Output:

<ul class="repositories">
	<li class="name-of-repository">
		<a class="gitty-name" title="name of repository" href="https://github.com/username/name-of-repository">name of repository</a>
		<span class="language">javascript</span>
		<span class="description">This is where the repository description would go.</span>
	</li>
	<li class="name-of-repository">
		<a class="gitty-name" title="name of repository" href="https://github.com/username/name-of-repository">name of repository</a>
		<span class="language">javascript</span>
		<span class="description">This is where the repository description would go.</span>
	</li>
</ul>

* Note that each list item has it's own unique class based on the name of the repository, so you can style each list item individually.