martile 0.6.37 → 0.6.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +3 -3
- data.tar.gz.sig +0 -0
- data/lib/martile.rb +25 -10
- metadata +1 -1
- 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: cd3eeb5b209ea2dbdfc78c4591177a08ef3b2969
|
|
4
|
+
data.tar.gz: a66e15bc31e24c297912d830eeefdf08889e8a9d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5ed12d55ac62cd35e3e6f240013992005dbc6c51584883840665b9ccf396074d54549d4a6b20bb18e0ead66c701ea703c4a44c4121ebd90eee2309eb60195829
|
|
7
|
+
data.tar.gz: d7f6a6430fcb7d32e45feeb187f76b1d4e3d0ea4205a8a3ccbfb2cf61c39a00ee1582737db706878196f66ecdd7c08212f9f219dbb31b23efbfff21d964293bd
|
checksums.yaml.gz.sig
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(
|
|
2
|
-
|
|
3
|
-
�
|
|
1
|
+
g��#G��ǵK��l'۪�=I�~�5i"m-����(X��������|c�����*�d$�#t|�tpֶ�ݠe�` ���D�r�Zv%�h��Y��)p��)�W@���#ٞ����1c9��e��w>��%�Ҧ[3o(�$U��ha��I-�G�g��K�����R��
|
|
2
|
+
��%�/�ZC*$�c���{�t�������j����3OB)��M��/f1l���Z\C&�
|
|
3
|
+
ȩ��֯3`#�5�_�*�nx��
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/lib/martile.rb
CHANGED
|
@@ -9,8 +9,11 @@ require 'rdiscount'
|
|
|
9
9
|
require 'kvx'
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
# feature: 28-May-2017
|
|
13
|
-
|
|
12
|
+
# feature: 28-May-2017 Within the context of an embedded Dynarex table,
|
|
13
|
+
# the nomarkdown extension was wrapped around the inner HTML for each column
|
|
14
|
+
#
|
|
15
|
+
# Return characters are now stripped out.
|
|
16
|
+
#
|
|
14
17
|
# An embeded Dynarex table contents are now rendered to
|
|
15
18
|
# Markdown by default
|
|
16
19
|
# feature: 11-Mar-2017 A details and summary tag can now be generated from +>
|
|
@@ -359,12 +362,13 @@ class Martile
|
|
|
359
362
|
|
|
360
363
|
def dx_render_table(dx, raw_select)
|
|
361
364
|
|
|
362
|
-
markdown = true
|
|
365
|
+
markdown, heading = true, true
|
|
363
366
|
|
|
364
367
|
if raw_select then
|
|
365
368
|
raw_fields = raw_select[/select:\s*["']([^"']+)/,1]
|
|
366
369
|
fields = raw_fields.split(/\s*,\s*/) if raw_fields
|
|
367
370
|
markdown = false if raw_select[/\bmarkdown:\s*false\b/]
|
|
371
|
+
heading = false if raw_select[/\bheading:\s*false\b/]
|
|
368
372
|
end
|
|
369
373
|
|
|
370
374
|
print_row = -> (row, widths) do
|
|
@@ -394,7 +398,7 @@ class Martile
|
|
|
394
398
|
|
|
395
399
|
row.map do |col|
|
|
396
400
|
|
|
397
|
-
found_match = col.match(
|
|
401
|
+
found_match = col.match(/^https?:\/\/([^\/]+)(.*)/)
|
|
398
402
|
|
|
399
403
|
r = if found_match then
|
|
400
404
|
|
|
@@ -405,8 +409,17 @@ class Martile
|
|
|
405
409
|
url_title = (a.join('.') + path)[0..39] + '...'
|
|
406
410
|
|
|
407
411
|
"[%s](%s)" % [url_title, col]
|
|
412
|
+
|
|
408
413
|
else
|
|
409
|
-
|
|
414
|
+
|
|
415
|
+
if markdown then
|
|
416
|
+
"{::nomarkdown}" +
|
|
417
|
+
RDiscount.new(col).to_html.strip.gsub("\n",'') + "{:/}"
|
|
418
|
+
else
|
|
419
|
+
|
|
420
|
+
col
|
|
421
|
+
|
|
422
|
+
end
|
|
410
423
|
|
|
411
424
|
end
|
|
412
425
|
|
|
@@ -415,12 +428,14 @@ class Martile
|
|
|
415
428
|
end
|
|
416
429
|
|
|
417
430
|
widths = ([keys] + vals).transpose.map{|x| x.max_by(&:length).length}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
tb = print_rows.call(vals, widths)
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
th = heading ? print_row.call(keys, widths) : ''
|
|
434
|
+
th_line = print_thline.call widths.map {|x| '-' * (x+1)}, widths
|
|
435
|
+
tb = print_rows.call(vals, widths)
|
|
436
|
+
|
|
423
437
|
table = th + th_line + tb
|
|
438
|
+
|
|
424
439
|
end
|
|
425
440
|
|
|
426
441
|
def unordered_list_to_html(s)
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
Binary file
|