yatoc 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/yatoc.rb +16 -3
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40a564c4d8640c24dceb46c1a5c72c65f676ec60ad35abd602ddd3805ba97406
|
4
|
+
data.tar.gz: 494e5302f6f6b77a501ac0daae0b89b766ad8fdee7b1c9a0ae7d329c03cb7947
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bcd481f3f4def5a78d9fe286d8d21d7af148ddbe27a77eba5934f117bc21965a016dd9fb06606b0e2cca06cbfff7b27a0fd84ad10a2492daee323e2488db439
|
7
|
+
data.tar.gz: 0725357e0c868d61c11f326b5dcb43ee17212e3c6a121382ed4b50132038f700e5c9abbf1896807bd26bad9a85011cd8c30d2d4cfb6c0f90e371cee7abc305a5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/yatoc.rb
CHANGED
@@ -19,31 +19,44 @@ class Yatoc
|
|
19
19
|
@numbered, @debug, @content = numbered, debug, content
|
20
20
|
|
21
21
|
|
22
|
-
if content =~ /<index[^>]+>/ then
|
22
|
+
@to_html = if content =~ /<index[^>]+>/ then
|
23
23
|
|
24
24
|
@numbered ||= false
|
25
|
+
puts '1. ready to gen_index'.info if @debug
|
25
26
|
html2 = gen_index(content)
|
26
27
|
puts 'html2: ' + html2.inspect
|
27
|
-
|
28
|
+
"%s\n\n<div class='main'>%s</div>" % \
|
28
29
|
[html2, content.sub(/<index[^>]+>/, '')]
|
29
30
|
|
30
31
|
elsif content =~ /<ix[^>]+>/ then
|
31
32
|
|
32
33
|
@numbered ||= false
|
34
|
+
puts '2. ready to gen_index'.info if @debug
|
33
35
|
html2 = gen_index(content, threshold: nil)
|
34
36
|
puts 'html2: ' + html2.inspect
|
35
|
-
|
37
|
+
"%s\n\n<div class='main'>%s</div>" % \
|
36
38
|
[html2, content.sub(/<ix[^>]+>/, '')]
|
37
39
|
|
38
40
|
elsif content.scan(/<h\d+/).length > min_sections
|
39
41
|
|
40
42
|
@numbered ||= true
|
43
|
+
puts 'ready to gen_toc()'.info if @debug
|
41
44
|
gen_toc(content)
|
42
45
|
|
46
|
+
else
|
47
|
+
|
48
|
+
content
|
49
|
+
|
43
50
|
end
|
44
51
|
|
52
|
+
|
53
|
+
# note: @to_html is important because this gem is used by the
|
54
|
+
# Martile gem which expect to pass HTML through to render any TOCs.
|
55
|
+
|
45
56
|
end
|
46
57
|
|
58
|
+
# use in conjunction with the <ix/> tag to render a sidebar
|
59
|
+
#
|
47
60
|
def to_css()
|
48
61
|
|
49
62
|
<<CSS
|
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.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
7RVV+J+oYjvww0tYfGq6N2tECM5thrQYj3cKLzAEEPYBjoWcPA5bqRXBTNta+k+K
|
36
36
|
tc7DELyeAZoKgZBO2wAc4FQ6
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2019-02-
|
38
|
+
date: 2019-02-03 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: pxindex
|
metadata.gz.sig
CHANGED
Binary file
|