martile 1.0.1 → 1.1.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: 19b57ab631c3ae6f611e3c376f1c59c03b3f1e85a0e586d3eb8d59467b497361
4
- data.tar.gz: e2f986cbbe92b16d795760da59dec37498ce28f8c0d565d6d2cd8c4740b29b14
3
+ metadata.gz: 1124782048fa0880bbe315f7f11027dfe5af85f6295a208bd25d82ca8a13fbbd
4
+ data.tar.gz: f8e8fe3391da738db85577e7f3389c4baf06a4f59ea2d2c59394e4928901701d
5
5
  SHA512:
6
- metadata.gz: b6cbd55a289bf4c29ca15641f044c3175c77dbf473523a0d5594300965d361fa3c26889e78ba652a543c8a44fe2c411d4d6f6d4f677ca080d9db6170eb6673f2
7
- data.tar.gz: 8ad3cced0643a65896a1e587bd4cfdd72c57bc06b064b49542b024bff6c91a777aae1d3563d7bb1f9f838131f5822c19485c17172d1b507f0d06513362626760
6
+ metadata.gz: 52a1f18d1695efafd854ed1b9d94d4254040d341ab7baed8328c283193f1920988c7772a8849c8a5e45f144f9dc6aa30f365d70e6dd94a83fa23357f0544491d
7
+ data.tar.gz: 195b72d5e9222aff857711ae286141b3ded71131622ecc719a953ca0aebe5ee7109b603c54221148ce4565c2feef1f478abd40fd21178f65c2151b01bb053208
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -13,6 +13,8 @@ require 'mindmapdoc'
13
13
  require 'flowchartviz'
14
14
 
15
15
 
16
+ # feature: 23-Dec-2018 A SectionX or KVX object can now be referenced
17
+ # from interpolated variables
16
18
  # feature: 17-Dec-2018 Now automatically generates a toc when there are 3
17
19
  # sections or more
18
20
  # feature: 3-Oct-2018 An embed tag can now be used to dynamically load content
@@ -131,8 +133,9 @@ class Martile
131
133
  s210 = apply_filter(s200) {|x| qrcodetag x }
132
134
  s220 = apply_filter(s210) {|x| svgtag x }
133
135
  s230 = apply_filter(s220) {|x| embedtag x }
136
+ s240 = apply_filter(s230) {|x| script_out x }
134
137
 
135
- @to_s = s230
138
+ @to_s = s240
136
139
 
137
140
  s240 = Yatoc.new(Kramdown::Document.new(s230).to_html, debug: debug).to_html
138
141
  puts ('s240:' + s240.inspect).debug if debug
@@ -567,9 +570,32 @@ class Martile
567
570
  a = s.split(/^__DATA__$/,2)
568
571
 
569
572
  data = a[-1]
570
-
571
- data.split(/(?=<\?)/).each do |x|
572
573
 
574
+ links, locals = data.split(/(?=<)/, 2)
575
+
576
+ links.strip.split("\n").each do |line|
577
+
578
+ puts ('line:' + line.inspect).debug if @debug
579
+ next if line.nil?
580
+
581
+ id, url = line.split(/:\s+/,2)
582
+ puts 'id: ' + id.inspect if @debug
583
+ puts 'url: ' + url.inspect if @debug
584
+
585
+ obj, _ = RXFHelper.read(url, auto: true)
586
+ define_singleton_method(id.to_sym) { @data_source[id] }
587
+ @data_source[id] = obj
588
+
589
+ end
590
+
591
+ puts 'before locals' if @debug
592
+
593
+ locals ||= ''
594
+
595
+ locals.split(/(?=<\?)/).each do |x|
596
+
597
+ puts ('__data__ x: ' + x.inspect).debug if @debug
598
+
573
599
  s2 = x.strip
574
600
  next if s2.empty?
575
601
 
@@ -589,6 +615,21 @@ class Martile
589
615
  when /^<\?flowchart(?:viz)? /
590
616
 
591
617
  Flowchartviz.new s2
618
+
619
+ when /^<\?sectionx /
620
+
621
+ sx = SectionX.new
622
+ sx.import s2
623
+ define_singleton_method(id.to_sym) { @data_source[id] }
624
+ sx
625
+
626
+ when /^<\?kvx /
627
+
628
+ kvx = Kvx.new s2
629
+
630
+ define_singleton_method(id.to_sym) { @data_source[id] }
631
+ kvx
632
+
592
633
  end
593
634
  end
594
635
 
@@ -632,7 +673,11 @@ class Martile
632
673
 
633
674
  s.gsub(/\^[\w ]+\^/) {|x| "<mark>%s</mark>" % x[1..-2] }
634
675
 
635
- end
676
+ end
677
+
678
+ def script_out(s)
679
+ s.gsub(/({!)[^}]+\}/) {|x| eval(x[/(?<={!)[^}]+/]) }
680
+ end
636
681
 
637
682
  def smartlink(s)
638
683
 
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.0.1
4
+ version: 1.1.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: 2018-12-18 00:00:00.000000000 Z
33
+ date: 2018-12-23 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: yatoc
@@ -38,20 +38,20 @@ dependencies:
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '0.1'
41
+ version: '0.2'
42
42
  - - ">="
43
43
  - !ruby/object:Gem::Version
44
- version: 0.1.0
44
+ version: 0.2.1
45
45
  type: :runtime
46
46
  prerelease: false
47
47
  version_requirements: !ruby/object:Gem::Requirement
48
48
  requirements:
49
49
  - - "~>"
50
50
  - !ruby/object:Gem::Version
51
- version: '0.1'
51
+ version: '0.2'
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 0.1.0
54
+ version: 0.2.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rqrcode
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -81,7 +81,7 @@ dependencies:
81
81
  version: '0.3'
82
82
  - - ">="
83
83
  - !ruby/object:Gem::Version
84
- version: 0.3.0
84
+ version: 0.3.1
85
85
  type: :runtime
86
86
  prerelease: false
87
87
  version_requirements: !ruby/object:Gem::Requirement
@@ -91,7 +91,7 @@ dependencies:
91
91
  version: '0.3'
92
92
  - - ">="
93
93
  - !ruby/object:Gem::Version
94
- version: 0.3.0
94
+ version: 0.3.1
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: flowchartviz
97
97
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file