martile 1.2.0 → 1.2.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.tar.gz.sig +0 -0
- data/lib/martile.rb +28 -3
- metadata +1 -1
- 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: 45bed3d0771bb32b6215f3b90ed567171b628811ca7a1fa0f721a198945f5b35
|
4
|
+
data.tar.gz: 6f30e95b6696a2dc82ba117c91e0a7fe06a99822e02ad60abbf540ccf43f08a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b7da4fbed2332530432d3784eec11fb071db3ae66d3aebf7d3638ecc7a14418a5bd65cc9d299a23bbddc78b9b15d4b2380890bc4e748d3ea27218514b0ce1b0
|
7
|
+
data.tar.gz: 7e538b514e0d0e361585b16c65525fdff0caf2576c6eeaee1791b26ee0bdb9fc708ef246586e29844eef53a500cfdc6c924c7cf00545c3e6ca10fd7b52e9a52f
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/martile.rb
CHANGED
@@ -15,6 +15,7 @@ require 'jsmenubuilder'
|
|
15
15
|
|
16
16
|
|
17
17
|
# feature: 16-Jul-2019 An HTML Tabs component can now be created from XML
|
18
|
+
# XML can now be created using !tag notation e.g. !tabs
|
18
19
|
# feature: 05-May-2019 Dimensions can now be supplied for an iframe
|
19
20
|
# improvment: 06-Mar-2019 Checks for mindmap tags outside of other tags
|
20
21
|
# feature: 03-Mar-2019 A high level mindmap with associated doc can now be
|
@@ -154,7 +155,8 @@ class Martile
|
|
154
155
|
|
155
156
|
s250 = apply_filter(s240) {|x| nomarkdown x }
|
156
157
|
|
157
|
-
|
158
|
+
s253 = bang_xml(s250)
|
159
|
+
s255 = tabs(s253)
|
158
160
|
s260 = Yatoc.new(Kramdown::Document.new(s255).to_html, debug: debug).to_html
|
159
161
|
puts ('s260: ' + s260.inspect).debug if debug
|
160
162
|
|
@@ -228,7 +230,30 @@ class Martile
|
|
228
230
|
"<audio controls='controls'>\n%s\n</audio>" % [sources.join("\n")]
|
229
231
|
end
|
230
232
|
|
231
|
-
end
|
233
|
+
end
|
234
|
+
|
235
|
+
def bang_xml(s)
|
236
|
+
|
237
|
+
indent = -> (line) { ' ' + line }
|
238
|
+
a = s.split(/(?=^\!\w+)/)
|
239
|
+
|
240
|
+
a.map do |s|
|
241
|
+
|
242
|
+
if s =~ /^!!/ then
|
243
|
+
|
244
|
+
parent, children = s.split(/^!!/,2)
|
245
|
+
tree = parent.sub(/^!/,'') + children.split(/^!!/).map do |x|
|
246
|
+
x.lines[1..-1].map(&indent).unshift(x.lines[0]).map(&indent)
|
247
|
+
end.join
|
248
|
+
|
249
|
+
LineTree.new(tree).to_xml(declaration: false)
|
250
|
+
|
251
|
+
else
|
252
|
+
s
|
253
|
+
end
|
254
|
+
|
255
|
+
end.join
|
256
|
+
end
|
232
257
|
|
233
258
|
def code_block_to_html(s)
|
234
259
|
|
@@ -741,7 +766,7 @@ class Martile
|
|
741
766
|
a.each do |html|
|
742
767
|
|
743
768
|
istart = s =~ /^<tabs[^>]*>/
|
744
|
-
iend = s =~
|
769
|
+
iend = s =~ /<\/tabs>/
|
745
770
|
s.slice!(istart, (iend - istart) + '</tab>'.length + 1)
|
746
771
|
s.insert(istart, html)
|
747
772
|
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|