GithubHelp home page GithubHelp logo

imclab / github-widget Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jawj/github-widget

0.0 1.0 0.0 212 KB

Simple script to display own GitHub projects on a webpage, ordered by number of watchers

Home Page: http://mackerron.com/webdev/

CoffeeScript 72.81% CSS 15.75% HTML 11.44%

github-widget's Introduction

Demo

See http://mackerron.com/webdev/ for an example of the widget in action.

What does it do?

It lets you show an up-to-date list of one or more users' GitHub repositories on another webpage.

It pulls the data from the GitHub JSON-P API, builds some simple HTML from it, and styles this with CSS.

It ignores: forks; any GitHub home page repo (username.github.com); and any repo with no description. It sorts what's left by descending number of watchers (now 'stars').

It works back to IE6 (though some of the styling is ugly there, and it's not super-relevant, given that GitHub doesn't).

It's less than 3KB minified, and has no dependencies.

How do I use it?

Get the code

If you have git installed, go to your website's root folder and paste in:

git clone https://github.com/jawj/github-widget.git

Alternatively, you can download an up-to-date ZIP file from https://github.com/jawj/github-widget/zipball/master.

Set it up

To the <head> of the page, add:

<link href="github-widget/github-widget.css" rel="stylesheet" type="text/css" />

At any page location where you want to show a GitHub repository, paste in:

<div class="github-widget" data-user="some-github-username"></div>

Replacing the value of the data-user attribute with an actual GitHub username.

You may include additional options in the form of a JSON hash in an attribute called data-options and the following options are currently supported: sortBy, limit, and forks.

<div class="github-widget" data-user="some-github-username" data-options='{"sortBy":"stargazers_count", "limit":6}'></div>

Finally, immediately before the closing </body> tag, add:

<script src="github-widget/github-widget.min.js"></script>

Customise it

Edit the CSS file as you desire.

github-widget's People

Contributors

jawj avatar mos3abof avatar notatestuser avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.