martile 1.1.9 → 1.2.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: 445281e12c8f376f78b11e9dd15c64f4100bcef0f43a3b1b5677f6839230e9ca
4
- data.tar.gz: 14203ff4903cd96d1e5dc8855ab53aff61f433c89186468bc691156f67563b42
3
+ metadata.gz: be76b25bcef2907f0d7603e5576018fe669ca9b954fff5b14bd002ba648a20f0
4
+ data.tar.gz: 2c66373e1409180abc5d6f06f1698e516bf0fe658b792cd68e36ed866c9781be
5
5
  SHA512:
6
- metadata.gz: 6dbed2b98a733948b790a5559e9a3d6fb75a24a59078b7c6f4d6576aa91a5f6e65a1a580acd826e5eb28bab5c00d4114125160fd330c0e9d4368b9d906285e49
7
- data.tar.gz: 5bd64f861d26f65037c4e1f67a6108f901d616fceddd00546bfeb9df3b90ee57755657a511de0f57891155507bb3e447dbefe445f8e0f0acc189a40001a0c7af
6
+ metadata.gz: 5bae3c21b1974e818bb50d36b593b1c98f8ebf0ad559fe6aeab269bc43fbb34ea31e50e53abd7e9fbaecd52356e07786db6a0c1b22f02b8a233302bf2b35f925
7
+ data.tar.gz: f94ae42b6b29daedb73d810e2acc0a24bf41724d49e9ff83ce20d3822de73838591f65dcb9415c47a209a9fdeaa7d5c9da0acdb9d42ff7c0d45ad8ffd5ea798d
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -11,8 +11,10 @@ require 'rqrcode'
11
11
  #require 'rdiscount'
12
12
  require 'mindmapdoc'
13
13
  require 'flowchartviz'
14
+ require 'jsmenubuilder'
14
15
 
15
16
 
17
+ # feature: 16-Jul-2019 An HTML Tabs component can now be created from XML
16
18
  # feature: 05-May-2019 Dimensions can now be supplied for an iframe
17
19
  # improvment: 06-Mar-2019 Checks for mindmap tags outside of other tags
18
20
  # feature: 03-Mar-2019 A high level mindmap with associated doc can now be
@@ -76,7 +78,7 @@ require 'flowchartviz'
76
78
  class Martile
77
79
  using ColouredText
78
80
 
79
- attr_reader :to_s, :to_html, :data_source, :to_css
81
+ attr_reader :to_s, :to_html, :data_source
80
82
 
81
83
  def initialize(raw_s='', ignore_domainlabel: nil, debug: false, log: nil)
82
84
 
@@ -86,14 +88,15 @@ class Martile
86
88
 
87
89
  @ignore_domainlabel, @log = ignore_domainlabel, log
88
90
 
89
- @css = []
91
+ @css, @js = [], []
90
92
 
91
93
  raw_s.gsub!("\r",'')
92
94
 
93
95
  mmd = MindmapDoc.new(debug: debug)
94
96
  s5 = apply_filter(raw_s) {|x| mmd.to_mmd(x) }
95
97
  s10 = apply_filter(s5) {|x| mmd.transform(s5) }
96
- puts 's10: ' + s10.inspect if debug
98
+ #puts 's10: ' + s10.inspect if debug
99
+ #s10 = raw_s
97
100
  s20 = s10 =~ /^__DATA__$/ ? parse__data__(s10) : s10
98
101
  puts ('s20: ' + s20.inspect).debug if debug
99
102
 
@@ -147,10 +150,12 @@ class Martile
147
150
  s230 = apply_filter(s220) {|x| embedtag x }
148
151
  s240 = apply_filter(s230) {|x| script_out x }
149
152
 
150
- @to_s = s240
153
+ @to_s = s240.to_s
151
154
 
152
155
  s250 = apply_filter(s240) {|x| nomarkdown x }
153
- s260 = Yatoc.new(Kramdown::Document.new(s250).to_html, debug: debug).to_html
156
+
157
+ s255 = tabs(s250)
158
+ s260 = Yatoc.new(Kramdown::Document.new(s255).to_html, debug: debug).to_html
154
159
  puts ('s260: ' + s260.inspect).debug if debug
155
160
 
156
161
  #puts 's17 : ' + s17.inspect
@@ -201,7 +206,10 @@ class Martile
201
206
  @css.join("\n")
202
207
  end
203
208
 
204
-
209
+ def to_js()
210
+ @js.join("\n")
211
+ end
212
+
205
213
  private
206
214
 
207
215
  def audiotag(s)
@@ -653,6 +661,18 @@ class Martile
653
661
 
654
662
  Flowchartviz.new s2
655
663
 
664
+ when /^<\?graphvizml /
665
+
666
+ GraphVizML.new s2
667
+
668
+ when /^<\?pxgraphviz /
669
+ puts 'before PxGraphViz.new'.info if @debug
670
+ PxGraphViz.new s2, debug: @debug
671
+
672
+ when /^<\?depviz /
673
+
674
+ DepViz.new s2
675
+
656
676
  when /^<\?sectionx /
657
677
 
658
678
  sx = SectionX.new
@@ -697,6 +717,39 @@ class Martile
697
717
  end
698
718
  return s
699
719
  end
720
+
721
+ def tabs(s1)
722
+
723
+ s = s1.clone
724
+
725
+ doc = Rexle.new("<root>#{s}</root>")
726
+
727
+ a = doc.root.xpath('tabs').map.with_index do |e, i |
728
+
729
+ build = JsMenuBuilder.new()
730
+ build.import(e.xml)
731
+
732
+ if i < 1 then
733
+ @css << build.to_css
734
+ @js << build.to_js
735
+ end
736
+
737
+ build.to_html
738
+
739
+ end
740
+
741
+ a.each do |html|
742
+
743
+ istart = s =~ /^<tabs[^>]*>/
744
+ iend = s =~ /^<\/tabs>/
745
+ s.slice!(istart, (iend - istart) + '</tab>'.length + 1)
746
+ s.insert(istart, html)
747
+
748
+ end
749
+
750
+ return s
751
+
752
+ end
700
753
 
701
754
  def underline(s)
702
755
 
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.1.9
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -30,7 +30,7 @@ cert_chain:
30
30
  h9crBM07TwSkUs7Sqw12Wh0aEldB8f+8+8mRzbWrJxdYt0EC7ZeByVSu26XqSA9a
31
31
  QUQ=
32
32
  -----END CERTIFICATE-----
33
- date: 2019-05-05 00:00:00.000000000 Z
33
+ date: 2019-07-16 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: yatoc
@@ -112,6 +112,26 @@ dependencies:
112
112
  - - ">="
113
113
  - !ruby/object:Gem::Version
114
114
  version: 0.1.6
115
+ - !ruby/object:Gem::Dependency
116
+ name: jsmenubuilder
117
+ requirement: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - "~>"
120
+ - !ruby/object:Gem::Version
121
+ version: '0.2'
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: 0.2.2
125
+ type: :runtime
126
+ prerelease: false
127
+ version_requirements: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '0.2'
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: 0.2.2
115
135
  description:
116
136
  email: james@jamesrobertson.eu
117
137
  executables: []
metadata.gz.sig CHANGED
Binary file