martile 1.2.1 → 1.3.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
  SHA256:
3
- metadata.gz: 45bed3d0771bb32b6215f3b90ed567171b628811ca7a1fa0f721a198945f5b35
4
- data.tar.gz: 6f30e95b6696a2dc82ba117c91e0a7fe06a99822e02ad60abbf540ccf43f08a3
3
+ metadata.gz: b385e21a3ab1023ef2d570da9bb2a62efc26146250a5bfd4e20fd3ec990ef06d
4
+ data.tar.gz: f5acf9194da31afc5e1cf2b4d37cb6f69e6f6b52f41aac6cafca07969f3bb7d1
5
5
  SHA512:
6
- metadata.gz: 1b7da4fbed2332530432d3784eec11fb071db3ae66d3aebf7d3638ecc7a14418a5bd65cc9d299a23bbddc78b9b15d4b2380890bc4e748d3ea27218514b0ce1b0
7
- data.tar.gz: 7e538b514e0d0e361585b16c65525fdff0caf2576c6eeaee1791b26ee0bdb9fc708ef246586e29844eef53a500cfdc6c924c7cf00545c3e6ca10fd7b52e9a52f
6
+ metadata.gz: 88ea1fea26b15988059043ffcf375a18249d1d8b1dec70c16c5522e18fc223ab43080e698bbb2bfb117aa987b6a4d43e2e06c01fd917970fff833141d2782c91
7
+ data.tar.gz: 5d46d533bc864562d45a362bb41bc0d92fb565d6a8ed30f17749a549ab35c4b2abe66316b5228966594d2f76ec3ed1be90820175df205de1fe8af5d7d96b45b8
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -14,6 +14,8 @@ require 'flowchartviz'
14
14
  require 'jsmenubuilder'
15
15
 
16
16
 
17
+ # feature: 16-Sep-2019 An HTML Tree component can now be generated when
18
+ # the tag <sidebar/> is used
17
19
  # feature: 16-Jul-2019 An HTML Tabs component can now be created from XML
18
20
  # XML can now be created using !tag notation e.g. !tabs
19
21
  # feature: 05-May-2019 Dimensions can now be supplied for an iframe
@@ -81,7 +83,8 @@ class Martile
81
83
 
82
84
  attr_reader :to_s, :to_html, :data_source
83
85
 
84
- def initialize(raw_s='', ignore_domainlabel: nil, debug: false, log: nil)
86
+ def initialize(raw_s='', ignore_domainlabel: nil, toc: true, debug: false,
87
+ log: nil)
85
88
 
86
89
 
87
90
  @debug = debug
@@ -154,14 +157,24 @@ class Martile
154
157
  @to_s = s240.to_s
155
158
 
156
159
  s250 = apply_filter(s240) {|x| nomarkdown x }
157
-
158
- s253 = bang_xml(s250)
160
+ s252 = sidenav(s250)
161
+ s253 = bang_xml(s252)
162
+ puts ('s235 after bang_xml: ' + s253.inspect).debug if @debug
163
+
159
164
  s255 = tabs(s253)
160
- s260 = Yatoc.new(Kramdown::Document.new(s255).to_html, debug: debug).to_html
161
- puts ('s260: ' + s260.inspect).debug if debug
165
+ puts ('s255 after tabs: ' + s255.inspect).debug if @debug
162
166
 
163
- #puts 's17 : ' + s17.inspect
167
+ toc = false if s255 =~ /class=['"]sidenav['"]>/
164
168
 
169
+ s260 = if toc then
170
+ Yatoc.new(Kramdown::Document.new(s255).to_html, debug: debug).to_html
171
+ else
172
+ s255
173
+ end
174
+
175
+ puts ('s260: ' + s260.inspect).debug if debug
176
+ #puts 's17 : ' + s17.inspect
177
+
165
178
  @to_html = s260
166
179
 
167
180
  end
@@ -718,6 +731,28 @@ class Martile
718
731
  a[0..-2].join
719
732
 
720
733
  end
734
+
735
+ def sidenav(s1)
736
+
737
+ s = s1.clone
738
+ if s =~ /^<sidenav\/>/ then
739
+
740
+ s.sub!(/^<sidenav\/>/,'')
741
+ #jtb = JsTreeBuilder.new :tree, {src: tree, debug: true}
742
+ jtb = JsTreeBuilder.new(:sidebar, {src: s, hn: 2, debug: true})
743
+ html = jtb.to_webpage
744
+ doc = Rexle.new(html)
745
+ html2 = Kramdown::Document.new(Martile.new(s, toc: false).to_html)\
746
+ .to_html
747
+ div = Rexle.new("<div class='main'>%s</div>" % html2)
748
+
749
+ doc.root.element('body/ul').insert_after div.root
750
+ doc.xml(declaration: false)
751
+ else
752
+ s1
753
+ end
754
+
755
+ end
721
756
 
722
757
  def table_to_html(s)
723
758
 
@@ -748,7 +783,7 @@ class Martile
748
783
  s = s1.clone
749
784
 
750
785
  doc = Rexle.new("<root>#{s}</root>")
751
-
786
+ puts 'doc.root.xml: ' + doc.root.xml.inspect if @debug
752
787
  a = doc.root.xpath('tabs').map.with_index do |e, i |
753
788
 
754
789
  build = JsMenuBuilder.new()
@@ -762,7 +797,9 @@ class Martile
762
797
  build.to_html
763
798
 
764
799
  end
765
-
800
+ puts 'tabs a:' + a.inspect if @debug
801
+
802
+ # replaces the <tabs> XML with HTML
766
803
  a.each do |html|
767
804
 
768
805
  istart = s =~ /^<tabs[^>]*>/
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: martile
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -10,27 +10,32 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDXjCCAkagAwIBAgIBATANBgkqhkiG9w0BAQUFADAsMSowKAYDVQQDDCFnZW1t
14
- YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTgwNzIzMDk0NDI5WhcN
15
- MTkwNzIzMDk0NDI5WjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
16
- cnRzb24vREM9ZXUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCwfp13
17
- 9uVBVoJJp1oHHQalluwWpU3nz9Jc8ullSoGgqZIhyojes2xEYyLxpH7NrHaFkT+D
18
- nktpIBXGqBd4Ws3KOca4fWZc7SXeV4ZDsg0sZ3JhJeyBdXsNbSecbJAR9V1C8lke
19
- 66D57mq37JJUGXAdqobTbStJzsVs5NYMWKOdF4fxr9e81bLLVmwzlSV9zsfqv6BG
20
- qYstlCktdJZK75VBw81vlsu5LkS/hlabtTECkXXg/kbmZ4ap2JUU6OWGE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+ 6jg2WIgE1SSAq8SeDCEkqwLyvDirsS6jUfM20LXaGEeSPr4Vc6Y4FKYfrEv2Vp6S
35
+ g0+rPDPUCWKVNHo7BG5zGRDcLsJO0QeIILy/AQaSAE3lQiHmC47nhsiBK0qNehWa
36
+ 47XiKvz0ZVCGgrz4GEb723WC
32
37
  -----END CERTIFICATE-----
33
- date: 2019-07-16 00:00:00.000000000 Z
38
+ date: 2019-09-16 00:00:00.000000000 Z
34
39
  dependencies:
35
40
  - !ruby/object:Gem::Dependency
36
41
  name: yatoc
@@ -56,22 +61,22 @@ dependencies:
56
61
  name: rqrcode
57
62
  requirement: !ruby/object:Gem::Requirement
58
63
  requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '0.10'
62
64
  - - ">="
63
65
  - !ruby/object:Gem::Version
64
- version: 0.10.1
66
+ version: 1.0.0
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '1.0'
65
70
  type: :runtime
66
71
  prerelease: false
67
72
  version_requirements: !ruby/object:Gem::Requirement
68
73
  requirements:
69
- - - "~>"
70
- - !ruby/object:Gem::Version
71
- version: '0.10'
72
74
  - - ">="
73
75
  - !ruby/object:Gem::Version
74
- version: 0.10.1
76
+ version: 1.0.0
77
+ - - "~>"
78
+ - !ruby/object:Gem::Version
79
+ version: '1.0'
75
80
  - !ruby/object:Gem::Dependency
76
81
  name: mindmapdoc
77
82
  requirement: !ruby/object:Gem::Requirement
@@ -81,7 +86,7 @@ dependencies:
81
86
  version: '0.3'
82
87
  - - ">="
83
88
  - !ruby/object:Gem::Version
84
- version: 0.3.4
89
+ version: 0.3.7
85
90
  type: :runtime
86
91
  prerelease: false
87
92
  version_requirements: !ruby/object:Gem::Requirement
@@ -91,7 +96,7 @@ dependencies:
91
96
  version: '0.3'
92
97
  - - ">="
93
98
  - !ruby/object:Gem::Version
94
- version: 0.3.4
99
+ version: 0.3.7
95
100
  - !ruby/object:Gem::Dependency
96
101
  name: flowchartviz
97
102
  requirement: !ruby/object:Gem::Requirement
@@ -114,6 +119,26 @@ dependencies:
114
119
  version: 0.1.6
115
120
  - !ruby/object:Gem::Dependency
116
121
  name: jsmenubuilder
122
+ requirement: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - "~>"
125
+ - !ruby/object:Gem::Version
126
+ version: '0.2'
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: 0.2.3
130
+ type: :runtime
131
+ prerelease: false
132
+ version_requirements: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - "~>"
135
+ - !ruby/object:Gem::Version
136
+ version: '0.2'
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: 0.2.3
140
+ - !ruby/object:Gem::Dependency
141
+ name: jstreebuilder
117
142
  requirement: !ruby/object:Gem::Requirement
118
143
  requirements:
119
144
  - - "~>"
@@ -158,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
183
  - !ruby/object:Gem::Version
159
184
  version: '0'
160
185
  requirements: []
161
- rubygems_version: 3.0.1
186
+ rubygems_version: 3.0.3
162
187
  signing_key:
163
188
  specification_version: 4
164
189
  summary: Martile is a Markdown pre formatter which is designed to format custom Markdown
metadata.gz.sig CHANGED
Binary file