martile 1.3.0 → 1.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
  SHA256:
3
- metadata.gz: b385e21a3ab1023ef2d570da9bb2a62efc26146250a5bfd4e20fd3ec990ef06d
4
- data.tar.gz: f5acf9194da31afc5e1cf2b4d37cb6f69e6f6b52f41aac6cafca07969f3bb7d1
3
+ metadata.gz: 8fb9f0c5d9cf0623795ba66a2116f33dc06a756de0aea99a8cf954b82cd1a088
4
+ data.tar.gz: 918cff6aa70177d109dae4a82bd7da1eb69a0e3cf821e0cdf80223462c9bd6b3
5
5
  SHA512:
6
- metadata.gz: 88ea1fea26b15988059043ffcf375a18249d1d8b1dec70c16c5522e18fc223ab43080e698bbb2bfb117aa987b6a4d43e2e06c01fd917970fff833141d2782c91
7
- data.tar.gz: 5d46d533bc864562d45a362bb41bc0d92fb565d6a8ed30f17749a549ab35c4b2abe66316b5228966594d2f76ec3ed1be90820175df205de1fe8af5d7d96b45b8
6
+ metadata.gz: '0788c91db51446b301d09e5010e6b9578a0b0e937df178cbcb61ec17c3cc7a829e09ae6c287ef49e672aa6caa6d4bdc1ebe4081a29e3b8d6ef3b32233138dc2a'
7
+ data.tar.gz: ecfbe6d3e77975c97f315c3fb8d52258eac355412e6a4fbef5fe44d0898873442c017a8d6502b209f9a97dbca2339a42d8d87d72bc4a88b25b23232832995dd4
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -12,8 +12,11 @@ require 'rqrcode'
12
12
  require 'mindmapdoc'
13
13
  require 'flowchartviz'
14
14
  require 'jsmenubuilder'
15
+ require 'htmlcom'
15
16
 
16
17
 
18
+ # feature: 22-Jan-2020 An HtmlCom::Accordion component can now be generated
19
+ # using the tag <accordion>
17
20
  # feature: 16-Sep-2019 An HTML Tree component can now be generated when
18
21
  # the tag <sidebar/> is used
19
22
  # feature: 16-Jul-2019 An HTML Tabs component can now be created from XML
@@ -164,12 +167,14 @@ class Martile
164
167
  s255 = tabs(s253)
165
168
  puts ('s255 after tabs: ' + s255.inspect).debug if @debug
166
169
 
167
- toc = false if s255 =~ /class=['"]sidenav['"]>/
170
+ s257 = accordion(s255)
171
+
172
+ toc = false if s257 =~ /class=['"]sidenav['"]>/
168
173
 
169
174
  s260 = if toc then
170
- Yatoc.new(Kramdown::Document.new(s255).to_html, debug: debug).to_html
175
+ Yatoc.new(Kramdown::Document.new(s257).to_html, debug: debug).to_html
171
176
  else
172
- s255
177
+ s257
173
178
  end
174
179
 
175
180
  puts ('s260: ' + s260.inspect).debug if debug
@@ -227,6 +232,41 @@ class Martile
227
232
 
228
233
  private
229
234
 
235
+ def accordion(s1)
236
+
237
+ s = s1.clone
238
+
239
+ doc = Rexle.new("<root>#{s}</root>")
240
+ puts 'doc.root.xml: ' + doc.root.xml.inspect if @debug
241
+ a = doc.root.xpath('accordion').map.with_index do |e, i |
242
+
243
+ build = HtmlCom::Accordion.new(e.xml, debug: false)
244
+
245
+ if i < 1 then
246
+ @css << build.to_css
247
+ @js << build.to_js
248
+ end
249
+
250
+ build.to_html
251
+
252
+
253
+ end
254
+ puts 'accordion a:' + a.inspect if @debug
255
+
256
+ # replaces the <accordion> XML with HTML
257
+ a.each do |html|
258
+
259
+ istart = s =~ /^<accordion[^>]*>/
260
+ iend = s =~ /<\/accordion>/
261
+ s.slice!(istart, (iend - istart) + '</accordion>'.length + 1)
262
+ s.insert(istart, html)
263
+
264
+ end
265
+
266
+ return s
267
+
268
+ end
269
+
230
270
  def audiotag(s)
231
271
 
232
272
  s.gsub(/\B!a\[\]\((https?:\/\/[^\)]+)\)\B/) do |x|
@@ -305,7 +345,8 @@ class Martile
305
345
  x[2..-1].sub(/(.*)[^\+]+\n\+/m) do |x2|
306
346
 
307
347
  summary, detail = x2.split(/----+/,2)
308
- "<details><summary>%s</summary>%s</details>" % [summary, detail.chop]
348
+ "<details><summary>%s</summary>%s</details>" % \
349
+ [summary, Martile.new(detail.chop).to_html]
309
350
 
310
351
  end
311
352
 
@@ -739,7 +780,7 @@ class Martile
739
780
 
740
781
  s.sub!(/^<sidenav\/>/,'')
741
782
  #jtb = JsTreeBuilder.new :tree, {src: tree, debug: true}
742
- jtb = JsTreeBuilder.new(:sidebar, {src: s, hn: 2, debug: true})
783
+ jtb = JsTreeBuilder.new(:sidebar, {src: s, hn: 2, debug: @debug})
743
784
  html = jtb.to_webpage
744
785
  doc = Rexle.new(html)
745
786
  html2 = Kramdown::Document.new(Martile.new(s, toc: false).to_html)\
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.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  g0+rPDPUCWKVNHo7BG5zGRDcLsJO0QeIILy/AQaSAE3lQiHmC47nhsiBK0qNehWa
36
36
  47XiKvz0ZVCGgrz4GEb723WC
37
37
  -----END CERTIFICATE-----
38
- date: 2019-09-16 00:00:00.000000000 Z
38
+ date: 2020-01-22 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: yatoc
@@ -61,22 +61,22 @@ dependencies:
61
61
  name: rqrcode
62
62
  requirement: !ruby/object:Gem::Requirement
63
63
  requirements:
64
- - - ">="
65
- - !ruby/object:Gem::Version
66
- version: 1.0.0
67
64
  - - "~>"
68
65
  - !ruby/object:Gem::Version
69
- version: '1.0'
66
+ version: '1.1'
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: 1.1.2
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- version: 1.0.0
77
74
  - - "~>"
78
75
  - !ruby/object:Gem::Version
79
- version: '1.0'
76
+ version: '1.1'
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: 1.1.2
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: mindmapdoc
82
82
  requirement: !ruby/object:Gem::Requirement
@@ -126,7 +126,7 @@ dependencies:
126
126
  version: '0.2'
127
127
  - - ">="
128
128
  - !ruby/object:Gem::Version
129
- version: 0.2.3
129
+ version: 0.2.10
130
130
  type: :runtime
131
131
  prerelease: false
132
132
  version_requirements: !ruby/object:Gem::Requirement
@@ -136,7 +136,7 @@ dependencies:
136
136
  version: '0.2'
137
137
  - - ">="
138
138
  - !ruby/object:Gem::Version
139
- version: 0.2.3
139
+ version: 0.2.10
140
140
  - !ruby/object:Gem::Dependency
141
141
  name: jstreebuilder
142
142
  requirement: !ruby/object:Gem::Requirement
@@ -157,6 +157,26 @@ dependencies:
157
157
  - - ">="
158
158
  - !ruby/object:Gem::Version
159
159
  version: 0.2.2
160
+ - !ruby/object:Gem::Dependency
161
+ name: htmlcom
162
+ requirement: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: 0.2.0
167
+ - - "~>"
168
+ - !ruby/object:Gem::Version
169
+ version: '0.2'
170
+ type: :runtime
171
+ prerelease: false
172
+ version_requirements: !ruby/object:Gem::Requirement
173
+ requirements:
174
+ - - ">="
175
+ - !ruby/object:Gem::Version
176
+ version: 0.2.0
177
+ - - "~>"
178
+ - !ruby/object:Gem::Version
179
+ version: '0.2'
160
180
  description:
161
181
  email: james@jamesrobertson.eu
162
182
  executables: []
metadata.gz.sig CHANGED
Binary file