项目作者: Coding-Hen

项目描述 :
A small javascript plugin that displays recent gitlab activity
高级语言: JavaScript
项目地址: git://github.com/Coding-Hen/gitlab-activity.git
创建时间: 2018-09-17T23:17:00Z
项目社区:https://github.com/Coding-Hen/gitlab-activity

开源协议:MIT License

下载


GitHub Activity Stream Widget

This is a small Javascript plugin that creates a stream of your recent GitHub activity. It displays the user’s name, username, photo, and a list of each individual activity type. Click here for a demo.

Light Theme

Dark Theme

Dependencies

The two dependencies for the plugin are the Mustache templating library and Octicons (if you want the icons to show). You can include these along with the scripts for the plugin in the head of your page with the following HTML:

Using CDN

  1. <link rel="stylesheet" href="https://unpkg.com/octicons@4.4.0/build/font/octicons.css">
  2. <link rel="stylesheet" href="https://unpkg.com/github-activity-feed@latest/dist/github-activity.min.css">
  3. <script type="text/javascript" src="https://unpkg.com/mustache@4.2.0/mustache.min.js"></script>
  4. <script type="text/javascript" src="https://unpkg.com/github-activity-feed@latest/dist/github-activity.min.js"></script>
  5. <!-- if using dark theme add this in addition to the main CSS file -->
  6. <link rel="stylesheet" href="https://unpkg.com/github-activity-feed@latest/dist/github-activity.dark.min.css">

Using npm

Install the library:

  1. npm install --save github-activity-feed

Add the files to your webpage:

  1. <link rel="stylesheet" href="node_modules/octicons/build/font/octicons.css">
  2. <link rel="stylesheet" href="node_modules/github-activity-feed/dist/github-activity.min.css">
  3. <script type="text/javascript" src="node_modules/mustache/mustache.min.js"></script>
  4. <script type="text/javascript" src="node_modules/github-activity-feed/dist/github-activity.min.js"></script>
  5. <!-- if using dark theme add this in addition to the main CSS file -->
  6. <link rel="stylesheet" href="node_modules/github-activity-feed/dist/github-activity.dark.min.css">

Building

If you’d like to build the files yourself:

  1. # Install dependencies
  2. npm install
  3. # Build dist
  4. npx grunt

Usage

To use the library, begin by creating a new div with an id in the body of your page:

  1. <div id="feed"></div>

Then call the feed method via Javascript:

  1. GitHubActivity.feed({
  2. username: "your-username",
  3. repository: "your-repo", // optional
  4. selector: "#feed",
  5. limit: 20, // optional
  6. });

Credits

Fork and Enjoy

Please feel free to contribute to the application by following the steps below:

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request