jekyll-github-chart 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +89 -0
- data/LICENSE.txt +21 -0
- data/README.md +73 -0
- data/Rakefile +1 -0
- data/jekyll-github-chart.gemspec +24 -0
- data/lib/jekyll-github-chart.rb +31 -0
- data/lib/jekyll-github-chart/version.rb +3 -0
- metadata +82 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4a840c77c3fef9bcd0750a1548b45f97a9846099ec0515e0fb1d67c9115f9377
|
4
|
+
data.tar.gz: 452d5bc74e7b1857007804f1bf48db21ebfceb07292f3a4529da3f2a397cb633
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2788316e37f107dbcbb5ede8eceb9cf265bc06f294d0219f55dd599c61efba92522a8b0bf0072d2a7e681c5c43599a4e9d41e5a8f64b3968094230d73c544916
|
7
|
+
data.tar.gz: 8f0943bf01dd3a4bc0c97ec897c3e282997cffca51f20ddb00dc9eeb3bdbd617b794326c80070a6c00d875fad7194cfdc177ab3e116e6b6f547f79a1711ecb2b
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
jekyll_github_chart (0.1.0)
|
5
|
+
githubchart (~> 3.1.0)
|
6
|
+
jekyll
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
addressable (2.7.0)
|
12
|
+
public_suffix (>= 2.0.2, < 5.0)
|
13
|
+
basiccache (1.0.0)
|
14
|
+
colorator (1.1.0)
|
15
|
+
concurrent-ruby (1.1.6)
|
16
|
+
curb (0.9.10)
|
17
|
+
em-websocket (0.5.1)
|
18
|
+
eventmachine (>= 0.12.9)
|
19
|
+
http_parser.rb (~> 0.6.0)
|
20
|
+
eventmachine (1.2.7)
|
21
|
+
ffi (1.13.1)
|
22
|
+
forwardable-extended (2.6.0)
|
23
|
+
githubchart (3.1.0)
|
24
|
+
githubstats (~> 2.0.0)
|
25
|
+
svgplot (~> 1.0.0)
|
26
|
+
githubstats (2.0.0)
|
27
|
+
basiccache (~> 1.0.0)
|
28
|
+
curb (~> 0.9.0)
|
29
|
+
nokogiri (~> 1.8.0)
|
30
|
+
http_parser.rb (0.6.0)
|
31
|
+
i18n (1.8.5)
|
32
|
+
concurrent-ruby (~> 1.0)
|
33
|
+
jekyll (4.1.1)
|
34
|
+
addressable (~> 2.4)
|
35
|
+
colorator (~> 1.0)
|
36
|
+
em-websocket (~> 0.5)
|
37
|
+
i18n (~> 1.0)
|
38
|
+
jekyll-sass-converter (~> 2.0)
|
39
|
+
jekyll-watch (~> 2.0)
|
40
|
+
kramdown (~> 2.1)
|
41
|
+
kramdown-parser-gfm (~> 1.0)
|
42
|
+
liquid (~> 4.0)
|
43
|
+
mercenary (~> 0.4.0)
|
44
|
+
pathutil (~> 0.9)
|
45
|
+
rouge (~> 3.0)
|
46
|
+
safe_yaml (~> 1.0)
|
47
|
+
terminal-table (~> 1.8)
|
48
|
+
jekyll-sass-converter (2.1.0)
|
49
|
+
sassc (> 2.0.1, < 3.0)
|
50
|
+
jekyll-watch (2.2.1)
|
51
|
+
listen (~> 3.0)
|
52
|
+
kramdown (2.3.0)
|
53
|
+
rexml
|
54
|
+
kramdown-parser-gfm (1.1.0)
|
55
|
+
kramdown (~> 2.0)
|
56
|
+
liquid (4.0.3)
|
57
|
+
listen (3.2.1)
|
58
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
59
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
60
|
+
mercenary (0.4.0)
|
61
|
+
mini_portile2 (2.3.0)
|
62
|
+
nokogiri (1.8.5)
|
63
|
+
mini_portile2 (~> 2.3.0)
|
64
|
+
pathutil (0.16.2)
|
65
|
+
forwardable-extended (~> 2.6)
|
66
|
+
public_suffix (4.0.5)
|
67
|
+
rake (12.3.3)
|
68
|
+
rb-fsevent (0.10.4)
|
69
|
+
rb-inotify (0.10.1)
|
70
|
+
ffi (~> 1.0)
|
71
|
+
rexml (3.2.4)
|
72
|
+
rouge (3.21.0)
|
73
|
+
safe_yaml (1.0.5)
|
74
|
+
sassc (2.4.0)
|
75
|
+
ffi (~> 1.9)
|
76
|
+
svgplot (1.0.0)
|
77
|
+
terminal-table (1.8.0)
|
78
|
+
unicode-display_width (~> 1.1, >= 1.1.1)
|
79
|
+
unicode-display_width (1.7.0)
|
80
|
+
|
81
|
+
PLATFORMS
|
82
|
+
ruby
|
83
|
+
|
84
|
+
DEPENDENCIES
|
85
|
+
jekyll_github_chart!
|
86
|
+
rake (~> 12.0)
|
87
|
+
|
88
|
+
BUNDLED WITH
|
89
|
+
2.1.4
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 kinduff
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
# Jekyll Github Chart
|
2
|
+
|
3
|
+
[![Gem Version](https://img.shields.io/gem/v/jekyll-github-chart.svg)](https://rubygems.org/gems/jekyll-github-chart)
|
4
|
+
[![MIT Licensed](https://img.shields.io/badge/license-MIT-green.svg)](https://tldrlegal.com/license/mit-license)
|
5
|
+
|
6
|
+
This Jekyll plugin provides a tag that takes a Github user and returns either an image or a raw SVG of the contribution graph.
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Add this line to your application's Gemfile:
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
group :jekyll_plugins do
|
14
|
+
gem 'jekyll_github_chart'
|
15
|
+
end
|
16
|
+
```
|
17
|
+
|
18
|
+
And then execute:
|
19
|
+
|
20
|
+
```shell
|
21
|
+
$ bundle install
|
22
|
+
```
|
23
|
+
|
24
|
+
Or install it yourself as:
|
25
|
+
|
26
|
+
```shell
|
27
|
+
$ gem install jekyll_github_chart
|
28
|
+
```
|
29
|
+
|
30
|
+
Finally, call the plugin in your `_config.yml` file.
|
31
|
+
|
32
|
+
```yaml
|
33
|
+
plugins:
|
34
|
+
- jekyll-github-chart
|
35
|
+
```
|
36
|
+
|
37
|
+
## Usage
|
38
|
+
|
39
|
+
You can call the tag with a the defaults like this.
|
40
|
+
|
41
|
+
```
|
42
|
+
{% github_chart username %}
|
43
|
+
```
|
44
|
+
|
45
|
+
This will generate an HTML `img` tag with an SVG encoded as a data URI. For example:
|
46
|
+
|
47
|
+
```
|
48
|
+
<img src='data:image/svg+xml;charset=utf-8,...' class='github-contributions' alt='username\'s Github contributions' />
|
49
|
+
```
|
50
|
+
|
51
|
+
There are 3 color schemes available: `default`, `old`, and `halloween`.
|
52
|
+
|
53
|
+
```
|
54
|
+
{% github_chart username halloween %}
|
55
|
+
```
|
56
|
+
|
57
|
+
Finally, if you don't want an `img` tag, you can pass a format argument to have a raw SVG output.
|
58
|
+
|
59
|
+
```
|
60
|
+
{% github_chart username halloween raw %}
|
61
|
+
```
|
62
|
+
|
63
|
+
## Special thanks
|
64
|
+
Thanks to [@akerl](https://github.com/akerl) for creating the [githubchart](https://github.com/akerl/githubchart) gem which is the foundation of this plugin.
|
65
|
+
|
66
|
+
## Contributing
|
67
|
+
|
68
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/kinduff/jekyll-github-chart.
|
69
|
+
|
70
|
+
|
71
|
+
## License
|
72
|
+
|
73
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require_relative 'lib/jekyll-github-chart/version'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = "jekyll-github-chart"
|
5
|
+
spec.version = JekyllGithubChart::VERSION
|
6
|
+
spec.authors = ["kinduff"]
|
7
|
+
spec.email = ["abarcadabra@gmail.com"]
|
8
|
+
|
9
|
+
spec.summary = %q{Generate an SVG of Github contributions data for Jekyll}
|
10
|
+
spec.description = %q{Uses GithubChart to convert a liquid tag into a Github contribution SVG}
|
11
|
+
spec.homepage = "https://github.com/kinduff/jekyll-github-chart"
|
12
|
+
spec.license = "MIT"
|
13
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
14
|
+
|
15
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
16
|
+
spec.metadata["source_code_uri"] = "https://github.com/kinduff/jekyll-github-chart"
|
17
|
+
|
18
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
19
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
|
+
end
|
21
|
+
|
22
|
+
spec.add_runtime_dependency 'githubchart', '~> 3.1.0'
|
23
|
+
spec.add_runtime_dependency 'jekyll'
|
24
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require "jekyll"
|
2
|
+
require "githubchart"
|
3
|
+
require "jekyll-github-chart/version"
|
4
|
+
|
5
|
+
module Jekyll
|
6
|
+
module JekyllGithubChart
|
7
|
+
class JekyllGithubChartTag < Liquid::Tag
|
8
|
+
def initialize(tag_name, text, tokens)
|
9
|
+
super
|
10
|
+
opts = text.split(' ').map(&:strip)
|
11
|
+
@user = opts[0]
|
12
|
+
@scheme = opts[1] || 'default' # old, halloween
|
13
|
+
@format = opts[2] || 'image' # raw
|
14
|
+
end
|
15
|
+
|
16
|
+
def render(context)
|
17
|
+
raw_svg = GithubChart.new({ user: @user, colors: @scheme.to_sym }).render(:svg)
|
18
|
+
|
19
|
+
return raw_svg if @format == 'raw'
|
20
|
+
|
21
|
+
content_type = 'image/svg+xml'
|
22
|
+
encoding = 'charset=utf-8'
|
23
|
+
data = CGI::escape(raw_svg).gsub('+', '%20')
|
24
|
+
|
25
|
+
"<img src='data:#{content_type};#{encoding},#{data}' class='github-contributions' alt='#{@user}\'s Github contributions' />"
|
26
|
+
end
|
27
|
+
|
28
|
+
Liquid::Template.register_tag('github_chart', self)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jekyll-github-chart
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- kinduff
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-08-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: githubchart
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 3.1.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 3.1.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: jekyll
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: Uses GithubChart to convert a liquid tag into a Github contribution SVG
|
42
|
+
email:
|
43
|
+
- abarcadabra@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- Gemfile
|
50
|
+
- Gemfile.lock
|
51
|
+
- LICENSE.txt
|
52
|
+
- README.md
|
53
|
+
- Rakefile
|
54
|
+
- jekyll-github-chart.gemspec
|
55
|
+
- lib/jekyll-github-chart.rb
|
56
|
+
- lib/jekyll-github-chart/version.rb
|
57
|
+
homepage: https://github.com/kinduff/jekyll-github-chart
|
58
|
+
licenses:
|
59
|
+
- MIT
|
60
|
+
metadata:
|
61
|
+
homepage_uri: https://github.com/kinduff/jekyll-github-chart
|
62
|
+
source_code_uri: https://github.com/kinduff/jekyll-github-chart
|
63
|
+
post_install_message:
|
64
|
+
rdoc_options: []
|
65
|
+
require_paths:
|
66
|
+
- lib
|
67
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: 2.3.0
|
72
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
requirements: []
|
78
|
+
rubygems_version: 3.0.6
|
79
|
+
signing_key:
|
80
|
+
specification_version: 4
|
81
|
+
summary: Generate an SVG of Github contributions data for Jekyll
|
82
|
+
test_files: []
|