jekyll-toc 0.6.0 → 0.7.0.alpha1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68e92c063b54eacb71796ab7de2b4767a3061fc71121ff87d031ece8485b5f3a
4
- data.tar.gz: b80ebeb9f1cb9171005b14ee8837632764acc6844bd9c1de9d9a6763fbe5a31f
3
+ metadata.gz: 216b7cc996afe5cf11876349eecb8911442b7eb510e709606056f68854a3191a
4
+ data.tar.gz: f34f11a6aabc56e42d388d1407cdda508423091f899ca9104028e8843dc80e3b
5
5
  SHA512:
6
- metadata.gz: a05d7eda8d7559cecec51805cb9053e00e36f71c1bc5f17ba22abcc710d93fd005f104f0f29967d0efd749675900da0723da744887a7fe408a64c69363842abc
7
- data.tar.gz: e5a073deb6e1a6d022e1f6ef91223359fcdb9ec7996bdf8c46041843b434671af887e83b74ae030332961b952a4832118b9f1511c41c70af0ec61142dffb20a2
6
+ metadata.gz: 20b72524b5aa6101bc15e26dc6ba483b2ab39af9e660c4d01346752546fa585daf5967e06986bcaaf4c22ee84db2560958348dbe8fdbd88e8d0e808eb87d732d
7
+ data.tar.gz: 58a5bc0982197f7118e249957bb465aa849dae8b42f1e6ded5f9c7425f16a49ede11814da24379cf5c88059bc27be988182de25a29e771d3296801cbcce29226
@@ -2,9 +2,9 @@ language: ruby
2
2
  cache: bundler
3
3
  rvm:
4
4
  - 2.2
5
- - 2.3.4
6
- - 2.4.1
7
- - 2.5.0
5
+ - 2.3.7
6
+ - 2.4.4
7
+ - 2.5.1
8
8
  # gemfile is generated by appraisal
9
9
  gemfile:
10
10
  - gemfiles/jekyll_3.8.gemfile
data/README.md CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/toshimaru/jekyll-toc.svg?branch=master)](https://travis-ci.org/toshimaru/jekyll-toc)
4
4
  [![Gem Version](https://badge.fury.io/rb/jekyll-toc.svg)](http://badge.fury.io/rb/jekyll-toc)
5
- [![Dependency Status](https://gemnasium.com/toshimaru/jekyll-toc.svg)](https://gemnasium.com/toshimaru/jekyll-toc)
6
5
  [![Code Climate](https://codeclimate.com/github/toshimaru/jekyll-toc/badges/gpa.svg)](https://codeclimate.com/github/toshimaru/jekyll-toc)
7
6
  [![Test Coverage](https://api.codeclimate.com/v1/badges/cd56b207f327603662a1/test_coverage)](https://codeclimate.com/github/toshimaru/jekyll-toc/test_coverage)
8
7
 
@@ -21,8 +20,6 @@ plugins:
21
20
  - jekyll-toc
22
21
  ```
23
22
 
24
- **NOTE: If you're using older Jekyll version(v3.4 or earlier), use `gems` instead of `plugins`.**
25
-
26
23
  Set `toc: true` in posts for which you want the TOC to appear.
27
24
 
28
25
  ```yml
@@ -57,6 +57,7 @@ module Jekyll
57
57
  uniq: uniq,
58
58
  text: text,
59
59
  node_name: node.name,
60
+ no_toc: node.attribute('class') && node.attribute('class').value.include?('no_toc'),
60
61
  content_node: header_content,
61
62
  h_num: node.name.delete('h').to_i
62
63
  }
@@ -73,7 +74,9 @@ module Jekyll
73
74
 
74
75
  while i < entries.count
75
76
  entry = entries[i]
76
- if entry[:h_num] == min_h_num
77
+ if entry[:no_toc]
78
+ # Do nothing / skip entry
79
+ elsif entry[:h_num] == min_h_num
77
80
  # If the current entry should not be indented in the list, add the entry to the list
78
81
  toc_list << %(<li class="toc-entry toc-#{entry[:node_name]}"><a href="##{entry[:id]}#{entry[:uniq]}">#{entry[:text]}</a>)
79
82
  # If the next entry should be indented in the list, generate a sublist
@@ -1,3 +1,3 @@
1
1
  module JekyllToc
2
- VERSION = '0.6.0'.freeze
2
+ VERSION = '0.7.0.alpha1'.freeze
3
3
  end
@@ -12,6 +12,7 @@ SIMPLE_HTML = <<-HTML.freeze
12
12
  <h4>Simple H4</h4>
13
13
  <h5>Simple H5</h5>
14
14
  <h6>Simple H6</h6>
15
+ <h1 class="no_toc">No-toc H1</h1>
15
16
  HTML
16
17
 
17
18
  module TestHelpers
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-toc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0.alpha1
5
5
  platform: ruby
6
6
  authors:
7
7
  - toshimaru
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-05-05 00:00:00.000000000 Z
12
+ date: 2018-09-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -153,12 +153,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
153
153
  version: 2.2.2
154
154
  required_rubygems_version: !ruby/object:Gem::Requirement
155
155
  requirements:
156
- - - ">="
156
+ - - ">"
157
157
  - !ruby/object:Gem::Version
158
- version: '0'
158
+ version: 1.3.1
159
159
  requirements: []
160
160
  rubyforge_project:
161
- rubygems_version: 2.7.3
161
+ rubygems_version: 2.7.6
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: Jekyll Table of Contents plugin