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 +4 -4
- data/lib/daimon/markdown/plugin/toc.rb +2 -1
- data/lib/daimon/markdown/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2324f0c5fcb8c75bb8307546584480ba6ab0891
|
4
|
+
data.tar.gz: 7b9a33e2febd8456520b2cfd80de4c4fbdb3d300
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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!(/ /, "-")
|
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.
|
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-
|
11
|
+
date: 2016-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: html-pipeline
|