martile 1.1.4 → 1.1.5
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 +20 -8
- metadata +7 -7
- 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: 9ce1b5cd4dd3a72183018d96f394e8cd45254dbf4b8283078f57a7f0eb8f08d7
|
4
|
+
data.tar.gz: a451ab3b4fb24e0483f1754c052dfb834e5f5f5f28abf62aa53dcc13d6f9760f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26bde8febd5d761f8ea1336b51f53929cdfad701514f6c642def795955dc5bb9205767c457f4aaf478c4f3921223c435ae1daefcd8520843ca88075903e2894d
|
7
|
+
data.tar.gz: 8366488097f937bec77680e72ef8a80b3f2497116d2a68a41328b55d1c54bdefbe28744ed1cc347d2087406fdb55868c69ed93000b6af39a3c0884309f3e5a95
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/martile.rb
CHANGED
@@ -13,6 +13,8 @@ require 'mindmapdoc'
|
|
13
13
|
require 'flowchartviz'
|
14
14
|
|
15
15
|
|
16
|
+
# feature: 16-Feb-2019 A hidden field cam now be rendered using
|
17
|
+
# the syntax [? name: value]
|
16
18
|
# feature: 11-Feb-2019 An apostrophe used between words is now preserved
|
17
19
|
# from Kramdown HTML rendering
|
18
20
|
# feature: 23-Dec-2018 A SectionX or KVX object can now be referenced
|
@@ -151,9 +153,9 @@ class Martile
|
|
151
153
|
|
152
154
|
def create_form(s)
|
153
155
|
|
154
|
-
a = LineTree.new(s).to_a
|
155
|
-
|
156
|
-
def
|
156
|
+
a = LineTree.new(s, ignore_blank_lines: true).to_a
|
157
|
+
|
158
|
+
def create_form_input(raw_name)
|
157
159
|
|
158
160
|
name = raw_name.downcase[/\w+/]
|
159
161
|
type = name =~ /password/ ? :password : :text
|
@@ -164,16 +166,26 @@ class Martile
|
|
164
166
|
]
|
165
167
|
end
|
166
168
|
|
167
|
-
a2 = a[0][1..-1].select {|x| x[0] =~ /[^:]+\:/}.map do |
|
168
|
-
|
169
|
+
a2 = a[0][1..-1].select {|x| x[0] =~ /[^:]+\:/}.map do |items|
|
170
|
+
|
171
|
+
line = items[0]
|
172
|
+
case line
|
173
|
+
when /^\w/
|
174
|
+
create_form_input(line[/^\w[^:]+\:/])
|
175
|
+
when /!/
|
176
|
+
name, value = line.match(/\[\s*!\s+([^:]+):\s+([^\]]+)/).captures
|
177
|
+
['input', {type: 'hidden', name: name, value: value}]
|
178
|
+
end
|
169
179
|
end
|
170
180
|
|
171
|
-
button_name, link = s.match(/\[([^\]]+)\]\(
|
181
|
+
button_name, link = s.match(/\[([^\]]+)\]\(([^\)]+)\)/).captures
|
172
182
|
|
173
183
|
a2 << ['div', {class: 'button'}, ['button', {type: 'submit'}, button_name]]
|
174
184
|
|
175
185
|
a2.insert 0, 'form', {id: a[0][0], action: link, method: 'post'}
|
176
|
-
Rexle.new(a2)
|
186
|
+
doc = Rexle.new(a2)
|
187
|
+
doc.root.element('div/input').attributes['autofocus'] = 'true'
|
188
|
+
doc.xml pretty: true, declaration: false
|
177
189
|
|
178
190
|
end
|
179
191
|
|
@@ -300,7 +312,7 @@ class Martile
|
|
300
312
|
|
301
313
|
s.split(/(?=\n\w+)/).map do |s|
|
302
314
|
|
303
|
-
if s =~ /(?=\w+\n \w+: +\[ +\])/ then
|
315
|
+
if s =~ /(?=\w+\n\n* \w+: +\[ +\])/ then
|
304
316
|
create_form(s)
|
305
317
|
else
|
306
318
|
s
|
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.1.
|
4
|
+
version: 1.1.5
|
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: 2019-02-
|
33
|
+
date: 2019-02-16 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: yatoc
|
@@ -41,7 +41,7 @@ dependencies:
|
|
41
41
|
version: '0.3'
|
42
42
|
- - ">="
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version: 0.3.
|
44
|
+
version: 0.3.5
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
47
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -51,7 +51,7 @@ dependencies:
|
|
51
51
|
version: '0.3'
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.3.
|
54
|
+
version: 0.3.5
|
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.
|
84
|
+
version: 0.3.2
|
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.
|
94
|
+
version: 0.3.2
|
95
95
|
- !ruby/object:Gem::Dependency
|
96
96
|
name: flowchartviz
|
97
97
|
requirement: !ruby/object:Gem::Requirement
|
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: '0'
|
140
140
|
requirements: []
|
141
|
-
rubygems_version: 3.0.
|
141
|
+
rubygems_version: 3.0.1
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: Martile is a Markdown pre formatter which is designed to format custom Markdown
|
metadata.gz.sig
CHANGED
Binary file
|