yatoc 0.2.3 → 0.2.4

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
  SHA256:
3
- metadata.gz: 12de299cd3e07213f177e2f3f5b16df8fb47e01ad0082aee2f54dc5c7346371d
4
- data.tar.gz: 128d559f367e127ca25eaa09bfd6d41770f9cf224f426ceceed263a61b38a525
3
+ metadata.gz: 39affb3116e586f5382ba8d98504bb5e38ddd24c975f7523e298e374f70eacb4
4
+ data.tar.gz: '081f90c89281c13e0d52fc3117cfa7191286a2a086b1011bc26fdf01c8f88ff5'
5
5
  SHA512:
6
- metadata.gz: f0574299ff5a353b4376b3590320facf152a77296cd324d1d5830241ef865f9d550b911e70e56d932e733bd3d6623526d08206b4025abd158798b03d2530cc3d
7
- data.tar.gz: b6f99d5cdac709c5b32df535c529c78026d7e2db8b05ce7ba0723a2b92c69ba6acd564479e44a1981d3aa9c30ce4b16f816f647b926c221d9c710b9dd209ca69
6
+ metadata.gz: cf89f24dabea1385e23fa88da907d6780aae991d049252d15635a2c5d1e15140ef269e9b24211f301b4d7786fa0db6db96e88b4f1bc879825ad60b11e0b5bc54
7
+ data.tar.gz: 42b8bf8b5c78742b2be9fe1b1050b41c84a88e85118c487bdbddd1feb40cb30c5c4e744bbe90f4c2fccec0e2310ba727b0af4acc62597d327fe660f4f96483f1
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/yatoc.rb CHANGED
@@ -17,13 +17,19 @@ class Yatoc
17
17
 
18
18
  @numbered, @debug, @html = numbered, debug, html
19
19
 
20
- @to_html = if html.scan(/<h\d+/).length > min_sections then
21
-
22
- gen_toc(html)
20
+ @to_html = if html =~ /<index[^>]+>/ then
21
+
22
+ html2 = gen_index(html)
23
+ puts 'html2: ' + html2.inspect
24
+ html.sub(/<index[^>]+>/, "\n" + html2 + "\n")
25
+
26
+ elsif html.scan(/<h\d+/).length > min_sections
27
+
28
+ gen_toc(html)
23
29
 
24
30
  else
25
31
  html
26
- end
32
+ end
27
33
 
28
34
  end
29
35
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yatoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -103,8 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  requirements: []
106
- rubyforge_project:
107
- rubygems_version: 2.7.6
106
+ rubygems_version: 3.0.2
108
107
  signing_key:
109
108
  specification_version: 4
110
109
  summary: Yet Another Table Of Contents HTML generator.
metadata.gz.sig CHANGED
Binary file