daimon-markdown 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8d9ae79f89262e2e5b173fd510137589bc6356a
4
- data.tar.gz: b8e4072e934cac8da673c2efd259abc3435fba79
3
+ metadata.gz: c2324f0c5fcb8c75bb8307546584480ba6ab0891
4
+ data.tar.gz: 7b9a33e2febd8456520b2cfd80de4c4fbdb3d300
5
5
  SHA512:
6
- metadata.gz: f56abca8ff5b504bcdf82e984a3b86efc7df6fd065eaa63e49b7b7e894670c3bf7f456321d64f8bdbc2cd6838fd59c10ec0973e82970a9eeabca4a4ef463acbd
7
- data.tar.gz: b09300574c8c6475eda6c85ef1c8d2a9620743fa0be147e21fb08a2eaef5c527bf0577b9def206ec0d832e280a8bf27ed2b28b89fd368263fc6dbf3f9079ddcb
6
+ metadata.gz: 659504168c2212d33231c82e8c9d28e1a113c643ad99a1a23354706ed866ffda7faadf18afdf27a599b512bf6eabb3bd30eb61f674b4ad58276a4626066417f1
7
+ data.tar.gz: ec99f88c9ed69b2ed6c4b654595572e3063ca8d5f7aa668797c068087899031613ca74fdbfb607d15d2c8153aff64c2a237c66281ae4b8394f4dddafd9952702
@@ -4,7 +4,7 @@ module Daimon
4
4
  class TableOfContents < Base
5
5
  Plugin.register("toc", self)
6
6
 
7
- def call
7
+ def call(limit = nil)
8
8
  toc_html = ""
9
9
  items = []
10
10
 
@@ -12,6 +12,7 @@ module Daimon
12
12
  previous_level = 1
13
13
  doc.css("h1, h2, h3, h4, h5, h6").each do |header_node|
14
14
  level = header_node.name.tr("h", "").to_i
15
+ next if limit && limit < level
15
16
  text = header_node.text
16
17
  id = text.downcase
17
18
  id.gsub!(/ /, "-")
@@ -1,5 +1,5 @@
1
1
  module Daimon
2
2
  module Markdown
3
- VERSION = "0.3.0"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daimon-markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - daimon developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-31 00:00:00.000000000 Z
11
+ date: 2016-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: html-pipeline