jekyll-toc 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +40 -8
  3. data/jekyll-toc.gemspec +15 -10
  4. data/lib/version.rb +3 -0
  5. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8aa511b3cbd44f2e2e91f67187fef6d76a6357dc
4
- data.tar.gz: 3321ca103d225ae9b3d6818a40e19177f0e677b4
3
+ metadata.gz: 7a6987cd0c0489041a425e9da09b74af6847e148
4
+ data.tar.gz: 0eee9d6b1ed1eb887fea59a9f5f489a663d8bc8b
5
5
  SHA512:
6
- metadata.gz: a4b44bae9cc02828af5aa4032d3fcb6916bf7a9507e229bd57a01703efc43a34c643211a3fdd31da2eda224ba28379521657b90b694a860b08f97fb2c189ab97
7
- data.tar.gz: def0f70994dcba5d8904d2bd02cfbf36334f7bfa71a1b9c266b4666b665c14a0c0bcc325450d1cfc50eea098373acb1ec23f3390abca5dec7884cfc9c19ef22c
6
+ metadata.gz: be71a8215c97908a15d25a167753c9e66fd0d13a9f7663acdb3b26255fc26a5d0cfdc57f33923d35150d4ba3c5eda37aeb4fcc1c374a3f7f5dd0da81e3cc97e7
7
+ data.tar.gz: e28a6858a6d61be4f5fddb87374173861097983826d470ffbfaad5e79b71dcb5194d9a6954231664db0ee9632931bd1b2c52edfacccb2528ebdcff088972f0fd
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # This plugin is still WIP.
1
+ # jekyll-toc
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/jekyll-toc.svg)](http://badge.fury.io/rb/jekyll-toc)
4
4
  [![Dependency Status](https://gemnasium.com/toshimaru/jekyll-toc.svg)](https://gemnasium.com/toshimaru/jekyll-toc)
@@ -19,26 +19,58 @@ gems:
19
19
  - jekyll-toc
20
20
  ```
21
21
 
22
- Finally, add `toc` filter to your site's `{{ content }}`.
22
+ Add `toc` filter to your site's `{{ content }}` (e.g. `_layouts/post.html`).
23
23
 
24
24
  ```
25
25
  {{ content | toc }}
26
26
  ```
27
27
 
28
- ## Generated Tablle of Contents
28
+ Set `toc: true` in your posts.
29
+
30
+ ```yml
31
+ ---
32
+ layout: post
33
+ title: "Welcome to Jekyll!"
34
+ toc: true
35
+ ---
36
+ ```
37
+
38
+ ## Generated Table of Contents HTML
39
+
40
+ jekyll-toc generates Unordered List. The final output is as follows.
29
41
 
30
42
  ```html
31
- <ul>
32
- <li>foo</li>
33
- <li>bar</li>
43
+ <ul class="section-nav">
44
+ <li><a href="#heading1">Heading.1</a></li>
45
+ <li><a href="#heading2-1">Heading.2-1</a></li>
46
+ <li><a href="#heading2-2">Heading.2-2</a></li>
47
+ <li><a href="#heading3">Heading.3</a></li>
48
+ <li><a href="#heading2-3">Heading.2-3</a></li>
34
49
  </ul>
35
50
  ```
36
51
 
52
+ It looks like the image below.
53
+
54
+ ![screenshot](https://cloud.githubusercontent.com/assets/803398/5722561/7f59e8aa-9b80-11e4-9ee5-27a15192ee83.png)
55
+
37
56
  ## CSS Styling
38
57
 
58
+ The toc can be modified with CSS. The sample CSS is the following.
59
+
60
+ ```css
61
+ .section-nav {
62
+ background-color: #FFF;
63
+ margin: 5px 0;
64
+ padding: 10px 30px;
65
+ border: 1px solid #E8E8E8;
66
+ border-radius: 3px;
67
+ }
68
+ ```
69
+
70
+ ![screenshot](https://cloud.githubusercontent.com/assets/803398/5723662/f0bc84c8-9b88-11e4-986c-90608ca88184.png)
71
+
39
72
  ## TODO
40
- * more README
41
- * Close toc JavaScript
42
73
  * Test
43
74
  * Travis CI
44
75
  * Coverage & Coverall
76
+ * Close toc with JavaScript
@@ -1,14 +1,19 @@
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "version"
4
+
1
5
  Gem::Specification.new do |spec|
2
- spec.name = 'jekyll-toc'
3
- spec.version = '0.0.3'
4
- spec.summary = "Jekyll Table of Contents plugin"
5
- spec.description = "Jekyll plugin which generates a table of contents at the top of the content"
6
- spec.authors = ["Toshimaru"]
7
- spec.email = 'me@toshimaru.net'
8
- spec.files = `git ls-files -z`.split("\x0")
9
- spec.homepage = 'https://github.com/toshimaru/jekyll-toc'
10
- spec.license = 'MIT'
11
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
6
+ spec.name = 'jekyll-toc'
7
+ spec.version = JekyllToc::VERSION
8
+ spec.summary = "Jekyll Table of Contents plugin"
9
+ spec.description = "Jekyll plugin which generates a table of contents at the top of the content"
10
+ spec.authors = ["Toshimaru"]
11
+ spec.email = 'me@toshimaru.net'
12
+ spec.files = `git ls-files -z`.split("\x0")
13
+ spec.homepage = 'https://github.com/toshimaru/jekyll-toc'
14
+ spec.license = 'MIT'
15
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
16
+ spec.require_paths = ["lib"]
12
17
 
13
18
  spec.add_runtime_dependency "nokogiri", "~> 1.6"
14
19
  spec.add_development_dependency 'minitest', "~> 5.0"
@@ -0,0 +1,3 @@
1
+ module JekyllToc
2
+ VERSION = "0.0.4"
3
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-toc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toshimaru
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-12 00:00:00.000000000 Z
11
+ date: 2015-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -79,6 +79,7 @@ files:
79
79
  - Rakefile
80
80
  - jekyll-toc.gemspec
81
81
  - lib/jekyll-toc.rb
82
+ - lib/version.rb
82
83
  - test/test_helper.rb
83
84
  homepage: https://github.com/toshimaru/jekyll-toc
84
85
  licenses: