polyrex-headings 0.1.6 → 0.1.7
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 +5 -2
- data/lib/polyrex-headings.rb +15 -12
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 870674b32648e86eccf94f5397f2af82bfdd3248
|
4
|
+
data.tar.gz: fe4034fba1b8a3ca8a319c0c67cef4e7c319ac9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02f57705859b0249ce0047189c6e68d698e5f498c90ea52f6050874c5d988ea70975f2a420257fca900d0daa4b6bbb753d62319305c1f130bb278f20b126fdd1
|
7
|
+
data.tar.gz: 9180df54c04fc3507ac07312a2d55cbd1febc7f5ab38975a2a51aa113318baaa1c15a2f5b7746f6fdd0b417d322abc35bbe80c350fec523911de356b789ef2c1
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1,5 @@
|
|
1
|
-
�
|
2
|
-
|
1
|
+
O�g����o�6�n��:�e�<�\�S��E�9l65"h�b�
|
2
|
+
��Q���op�[4W���5�����? ��чF��� ���ݫt;��
|
3
|
+
�������W�D?c���_lW/�����0
|
4
|
+
GR�sWNum�_����k&�����c3�m߁�~��0T�zS�;0Q�+&��빂��(�T�.!�~!+f��ɓڧ+�B>+*g���e�����_G��:sPt���^��_��
|
5
|
+
��=m
|
data/lib/polyrex-headings.rb
CHANGED
@@ -15,6 +15,7 @@ class PolyrexHeadings
|
|
15
15
|
|
16
16
|
raw_s.gsub!(/(#+[^\n]+\n+)(?=\n#)/m,'\1 ')
|
17
17
|
summary, *s = raw_s.split(/(?=(?:^#|[\n]+\n-+))/,2)
|
18
|
+
type = nil
|
18
19
|
|
19
20
|
a = if raw_s =~ /----/ then
|
20
21
|
|
@@ -33,29 +34,31 @@ class PolyrexHeadings
|
|
33
34
|
end
|
34
35
|
|
35
36
|
else
|
37
|
+
|
38
|
+
a2 = summary.gsub(/\n{2,}/,"\n").lines
|
36
39
|
|
40
|
+
if a2.last =~ /^--+/ then
|
41
|
+
a2.pop
|
42
|
+
summary = a2.join
|
43
|
+
type = :rowx
|
44
|
+
end
|
45
|
+
|
37
46
|
s.join.split(/^\n*#/)[1..-1].map do |x|
|
38
47
|
|
39
|
-
|
40
48
|
lines = x.lines
|
41
|
-
|
42
49
|
raw_heading = lines.shift.rstrip
|
43
50
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
summary = a2.join
|
50
|
-
|
51
|
-
lines = ["\n"] + RowX.new(lines.join, level: 0).to_lines(delimiter: ' # ')
|
52
|
-
|
51
|
+
if type == :rowx
|
52
|
+
lines2 = ["\n"] +
|
53
|
+
RowX.new(lines.join, level: 0).to_lines(delimiter: ' # ') << "\n"
|
54
|
+
else
|
55
|
+
lines2 = lines
|
53
56
|
end
|
54
57
|
|
55
58
|
raw_indent = raw_heading.slice!(/#*/)
|
56
59
|
n, heading = raw_indent.length, raw_heading.lstrip
|
57
60
|
|
58
|
-
([indent(n) + heading] +
|
61
|
+
([indent(n) + heading] + lines2.map{|x| indent(n+1) + x}).join
|
59
62
|
end
|
60
63
|
|
61
64
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
@@ -1 +1,3 @@
|
|
1
|
-
�
|
1
|
+
6Ɨ�킞2 u��I]���)!QOI4O��$�Q��8�{��"X�ȗ�'��U�GX�g9P��GKû#Ln�Z�O�l'4���Ljg-X{��zX+�dj�焉o�\�].b����*���ވ�o�N$.6�
|
2
|
+
� �~���ˍT�"]VY!�n5��*Q�2ߖ�g�R�
|
3
|
+
��zk�=�*)Xl�ޙ��ey��D��n1�]��z;����3O8i�+�(H��Z�����옌3II�-P��ְ�/���
|