martile 0.7.0 → 0.7.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 +19 -4
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed3e1957a0c090c496c0e71c27630d957d14969d
|
4
|
+
data.tar.gz: fb8ea8ab7d332fd7327446610e5abc25b0c18894
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f07fd7863ec24b3793e0e0734ade4e233852e13e1ae79a13ebcb0db12c293b31d2e424b5f5e120a1900246fde4b3a3b8bb1c228c85ea3e9361739d2dd9a0437
|
7
|
+
data.tar.gz: 1f8d52b2d6cd2fb69df10885e65ed9368c3680ae8f96ae49b2658b2da4134dd8681b6057f67b5c77346987afd125b78679f9ae759c742429c512d84e3da052dc
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/martile.rb
CHANGED
@@ -9,6 +9,7 @@ require 'rdiscount'
|
|
9
9
|
require 'kvx'
|
10
10
|
|
11
11
|
|
12
|
+
# feature: 8-Sep-2017 An SVG object can now rendered from !s[]()
|
12
13
|
# feature: 6-Sep-2017 The preparation of a Dynarex table in Markdown is now
|
13
14
|
# done from the Dynarex object
|
14
15
|
# bug fix: 13-Aug-2017 bug fixes: A markdown table is no longer interpreted
|
@@ -107,10 +108,11 @@ class Martile
|
|
107
108
|
s18 = apply_filter(s17) {|x| hyperlinkify x }
|
108
109
|
s19 = apply_filter(s18) {|x| highlight x }
|
109
110
|
s20 = apply_filter(s19) {|x| details x }
|
111
|
+
s21 = apply_filter(s20) {|x| svgtag x }
|
110
112
|
|
111
113
|
#puts 's17 : ' + s17.inspect
|
112
114
|
|
113
|
-
@to_s =
|
115
|
+
@to_s = s21
|
114
116
|
end
|
115
117
|
|
116
118
|
def to_html()
|
@@ -368,17 +370,21 @@ class Martile
|
|
368
370
|
|
369
371
|
def dx_render_table(dx, raw_select)
|
370
372
|
|
371
|
-
fields, markdown, heading = nil, true, true
|
373
|
+
fields, markdown, heading, inner = nil, true, true, true
|
372
374
|
|
373
375
|
if raw_select then
|
376
|
+
|
374
377
|
raw_fields = raw_select[/select:\s*["']([^"']+)/,1]
|
378
|
+
|
375
379
|
fields = raw_fields.split(/\s*,\s*/) if raw_fields
|
376
380
|
inner = false if raw_select[/\bmarkdown:\s*false\b/]
|
377
381
|
heading = false if raw_select[/\bheading:\s*false\b/]
|
382
|
+
|
378
383
|
end
|
379
384
|
|
380
385
|
|
381
|
-
dx.to_table(markdown: true, innermarkdown: inner,
|
386
|
+
dx.to_table(markdown: true, fields: fields, innermarkdown: inner,
|
387
|
+
heading: heading)
|
382
388
|
end
|
383
389
|
|
384
390
|
def dx_render_table2(dx, raw_select)
|
@@ -519,7 +525,7 @@ class Martile
|
|
519
525
|
|
520
526
|
def highlight(s)
|
521
527
|
|
522
|
-
s.gsub(
|
528
|
+
s.gsub(/\^[\w ]+\^/) {|x| "<mark>%s</mark>" % x[1..-2] }
|
523
529
|
|
524
530
|
end
|
525
531
|
|
@@ -590,6 +596,15 @@ class Martile
|
|
590
596
|
a2.join
|
591
597
|
end
|
592
598
|
|
599
|
+
def svgtag(s)
|
600
|
+
|
601
|
+
s.gsub(/\B!s\[\]\((https?:\/\/[^\)]+)\)/) do |match, bo|
|
602
|
+
"<object data='#{$1}' type='image/svg+xml'></object>"
|
603
|
+
end
|
604
|
+
|
605
|
+
end
|
606
|
+
|
607
|
+
|
593
608
|
def videotag(s)
|
594
609
|
|
595
610
|
s.gsub(/\B!v\[\]\((https?:\/\/[^\)]+)\)(\{[^\}]+\})?/) do |match|
|
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: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
ta+wi0WcePPmMfSbCGQcYixXdM6qZvflWMz0AK44eQcm6OymMXgMQG6GvHPAl6s2
|
32
32
|
ASPGReskINIIrA==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2017-09-
|
34
|
+
date: 2017-09-08 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rdiscount
|
@@ -62,7 +62,7 @@ dependencies:
|
|
62
62
|
version: '1.7'
|
63
63
|
- - ">="
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version: 1.7.
|
65
|
+
version: 1.7.24
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
68
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -72,7 +72,7 @@ dependencies:
|
|
72
72
|
version: '1.7'
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.7.
|
75
|
+
version: 1.7.24
|
76
76
|
- !ruby/object:Gem::Dependency
|
77
77
|
name: kvx
|
78
78
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|