octopress-gist 1.3.4 → 1.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +37 -14
- data/lib/octopress-gist.rb +12 -3
- data/lib/octopress-gist/version.rb +1 -1
- metadata +4 -10
- data/.gitignore +0 -24
- data/.rspec +0 -2
- data/.travis.yml +0 -5
- data/Gemfile +0 -5
- data/Rakefile +0 -7
- data/octopress-gist.gemspec +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54829e7439f27aefd54486650424a91cc45ff853
|
4
|
+
data.tar.gz: 07229a17b65b4dad7d1d64ec14334efecb90ca0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f41aacc1afeba7492df6522736bd34c743285ebfc59dd58bcd1e67b282e103caf786d07eca7a5510d9683ab631c473bbf8dda778fcccecbd7c98705b79c40ff7
|
7
|
+
data.tar.gz: 2e1a6c97e816009c107bc46817974fc78e55ff5df651cb8ea6263700d22a862e72a69c8a5d614bab4ae0e6dadfaadd967dcff7312dfc3938e7b1dd74b04149f8
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -3,25 +3,30 @@
|
|
3
3
|
Embed GitHub Gists in your Jekyll or Octopress blog.
|
4
4
|
|
5
5
|
[![Build Status](https://travis-ci.org/octopress/gist.png?branch=master)](https://travis-ci.org/octopress/gist)
|
6
|
+
[![Gem Version](https://badge.fury.io/rb/octopress-gist.png)](https://badge.fury.io/rb/octopress-gist)
|
6
7
|
|
7
8
|
## Installation
|
8
9
|
|
9
|
-
|
10
|
+
### Using Bundler
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
Add this gem to your site's Gemfile in the `:jekyll_plugins` group:
|
13
|
+
|
14
|
+
group :jekyll_plugins do
|
15
|
+
gem 'octopress-gist'
|
16
|
+
end
|
14
17
|
|
15
|
-
|
18
|
+
Then install the gem with Bundler
|
16
19
|
|
17
20
|
$ bundle
|
18
21
|
|
19
|
-
|
22
|
+
### Manual Installation
|
20
23
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
24
|
+
$ gem install octopress-gist
|
25
|
+
|
26
|
+
Then add the gem to your Jekyll configuration.
|
27
|
+
|
28
|
+
gems:
|
29
|
+
-octopress-gist
|
25
30
|
|
26
31
|
## Usage
|
27
32
|
|
@@ -31,27 +36,45 @@ The gist syntax looks like this.
|
|
31
36
|
{% gist [gist_id] [file_name] [options] %}
|
32
37
|
```
|
33
38
|
|
39
|
+
### Options
|
40
|
+
|
41
|
+
Note that order does not matter.
|
42
|
+
|
43
|
+
| Options | Example | Description |
|
44
|
+
|:-------------|:-----------------------|:----------------------------------------------------------------------|
|
45
|
+
|`title` | `title:"Figure 1.A"` | Add a figcaption title. Defaults to Gist title (usually the filename). |
|
46
|
+
|`link_text` | `link_text:"Download"` | Text for the link to the gist, default: `"link"`. |
|
47
|
+
|`linenos` | `lineos:false` | Disable line numbering. |
|
48
|
+
|`start` | `start:5` | Start embedding the gist from the 5th line number. |
|
49
|
+
|`end` | `end:15` | Stop embedding the gist after 15th line number. |
|
50
|
+
|`range` | `range:5-15` | Embed lines 5-15 of the gist. |
|
51
|
+
|`mark` | `mark:5-7,10` | Highlight lines of code. This example marks lines 5,6,7 and 10. |
|
52
|
+
|`class` | `class:"solution"` | Add CSS class name(s) to the code `<figure>` element. |
|
53
|
+
|
34
54
|
A simple gist embed:
|
35
55
|
|
36
56
|
```
|
37
57
|
{% gist 5672127 %}
|
38
58
|
```
|
39
59
|
|
40
|
-
This will download the gist and render it with Octopress Pygments, caching both the raw gist, and the highlighted code.
|
60
|
+
This will download the gist and render it with Octopress Pygments, caching both the raw gist, and the highlighted code. If your Gist has multiple files, this will embed each file in its own code figure.
|
41
61
|
|
42
|
-
|
62
|
+
Here's a more complex example:
|
43
63
|
|
64
|
+
```
|
65
|
+
{% gist 5672127 title:"Some cool thing" range:5-10 %}
|
66
|
+
```
|
44
67
|
|
45
68
|
#### Embed single files in a gist
|
46
69
|
|
47
|
-
If your Gist has
|
70
|
+
If your Gist has multiple files but you wish to embed files individually, you can like this.
|
48
71
|
|
49
72
|
```
|
50
73
|
{% gist 13411532 some_gist_file_name.rb %}
|
51
74
|
|
52
75
|
Comments about this file
|
53
76
|
|
54
|
-
{% gist 13411532
|
77
|
+
{% gist 13411532 some_other_gist_file_name.rb %}
|
55
78
|
|
56
79
|
and so on...
|
57
80
|
```
|
data/lib/octopress-gist.rb
CHANGED
@@ -2,9 +2,7 @@ require 'liquid'
|
|
2
2
|
require 'octopress-code-highlighter'
|
3
3
|
require 'open-uri'
|
4
4
|
require 'json'
|
5
|
-
|
6
|
-
$:.unshift File.dirname(__FILE__)
|
7
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
5
|
+
require 'octopress-gist/version'
|
8
6
|
|
9
7
|
module Octopress
|
10
8
|
module Gist
|
@@ -17,3 +15,14 @@ end
|
|
17
15
|
Liquid::Template.register_tag('gist', Octopress::Gist::Tag)
|
18
16
|
Liquid::Template.register_tag('gistnocache', Octopress::Gist::NoCacheTag)
|
19
17
|
|
18
|
+
if defined? Octopress::Docs
|
19
|
+
Octopress::Docs.add({
|
20
|
+
name: "Octopress Gist",
|
21
|
+
gem: "octopress-gist",
|
22
|
+
description: "Embed GitHub Gists in your Jekyll or Octopress blog.",
|
23
|
+
path: File.expand_path(File.join(File.dirname(__FILE__), "../")),
|
24
|
+
source_url: "https://github.com/octopress/gist",
|
25
|
+
version: Octopress::Gist::VERSION
|
26
|
+
})
|
27
|
+
end
|
28
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octopress-gist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octopress-code-highlighter
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: RedCloth
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: clash
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -87,20 +87,14 @@ executables: []
|
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
-
- ".gitignore"
|
91
|
-
- ".rspec"
|
92
|
-
- ".travis.yml"
|
93
90
|
- CHANGELOG.md
|
94
|
-
- Gemfile
|
95
91
|
- LICENSE.txt
|
96
92
|
- README.md
|
97
|
-
- Rakefile
|
98
93
|
- lib/octopress-gist.rb
|
99
94
|
- lib/octopress-gist/cache.rb
|
100
95
|
- lib/octopress-gist/gist-no-cache.rb
|
101
96
|
- lib/octopress-gist/gist.rb
|
102
97
|
- lib/octopress-gist/version.rb
|
103
|
-
- octopress-gist.gemspec
|
104
98
|
homepage: https://github.com/octopress/gist
|
105
99
|
licenses:
|
106
100
|
- MIT
|
data/.gitignore
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
*.gem
|
2
|
-
*.rbc
|
3
|
-
.bundle
|
4
|
-
.config
|
5
|
-
.yardoc
|
6
|
-
Gemfile.lock
|
7
|
-
InstalledFiles
|
8
|
-
_yardoc
|
9
|
-
coverage
|
10
|
-
doc/
|
11
|
-
lib/bundler/man
|
12
|
-
pkg
|
13
|
-
rdoc
|
14
|
-
spec/reports
|
15
|
-
test/tmp
|
16
|
-
test/version_tmp
|
17
|
-
tmp
|
18
|
-
.DS_Store
|
19
|
-
.pygments-cache
|
20
|
-
_site
|
21
|
-
.gist-cache
|
22
|
-
.code-highlighter-cache
|
23
|
-
.sass-cache
|
24
|
-
site
|
data/.rspec
DELETED
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/Rakefile
DELETED
data/octopress-gist.gemspec
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'octopress-gist/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |gem|
|
7
|
-
gem.name = "octopress-gist"
|
8
|
-
gem.version = Octopress::Gist::VERSION
|
9
|
-
gem.authors = ["Brandon Mathis"]
|
10
|
-
gem.email = ["brandon@imathis.com"]
|
11
|
-
gem.description = %q{Embed GitHub gists, support caching, and multiple files per gist.}
|
12
|
-
gem.summary = %q{Embed GitHub gists, support caching, and multiple files per gist.}
|
13
|
-
gem.homepage = "https://github.com/octopress/gist"
|
14
|
-
gem.license = "MIT"
|
15
|
-
|
16
|
-
gem.add_runtime_dependency 'octopress-code-highlighter', '~> 4.2'
|
17
|
-
|
18
|
-
gem.add_development_dependency 'jekyll'
|
19
|
-
gem.add_development_dependency 'rake'
|
20
|
-
gem.add_development_dependency 'rspec'
|
21
|
-
gem.add_development_dependency 'RedCloth'
|
22
|
-
|
23
|
-
gem.files = `git ls-files`.split($/).reject {|f| f =~ /^test\// }
|
24
|
-
gem.require_paths = ["lib"]
|
25
|
-
end
|