wortsammler 2.0.0.dev1 → 2.0.0.dev2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/wortsammler/class.Traceable.md.rb +9 -7
- data/lib/wortsammler/class.Traceable.rb +74 -60
- data/lib/wortsammler/class.proolib.rb +17 -23
- data/lib/wortsammler/mdTraceParser.treetop +2 -2
- data/lib/wortsammler/version.rb +1 -1
- data/spec/tc_exp_003_reference.txt +9 -25
- data/spec/test_beautify.md +13 -0
- data/spec/test_beautify_reference.md +11 -0
- data/spec/wortsammler_spec.rb +132 -125
- data/testresults/wortsammler_testresults.html +37 -203
- data/testresults/wortsammler_testresults.log +3 -87
- data/wortsammler.gemspec +3 -1
- metadata +19 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b0cbf5661132a80d6e900399dd93ce8a8e8e8e29
|
4
|
+
data.tar.gz: 48626c5c5e12b4cd4861e4b63a2f4c212a9198dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 172d92bcf7844a271e0a7d9b3341e8f4ca55d16ae94db54719ef80fa6b09dacb30c5c45cca6d8afc2197d741515de4e6fc91583025f4f79cf8de1efacdc666c2
|
7
|
+
data.tar.gz: '0789244681f620cec0d01a8867b58b2bf2f24499f4feaaf642c5f20a4ebe0cde4662acfb6aeb18c4735a9dc8913a3743c6c5167a54132f7a35c1e0524b62f0bc'
|
@@ -13,6 +13,10 @@ Treetop.load File.dirname(__FILE__) + "/mdTraceParser.treetop"
|
|
13
13
|
class TraceableSet
|
14
14
|
|
15
15
|
|
16
|
+
def mk_hyperlink(id)
|
17
|
+
idm = id.gsub("_","-")
|
18
|
+
"[\[#{id}\]](#RT-#{idm})"
|
19
|
+
end
|
16
20
|
|
17
21
|
# this generates a synopsis of traces in markdown Format
|
18
22
|
# @param [Symbol] selectedCategory the the category of the Traceables
|
@@ -23,20 +27,18 @@ class TraceableSet
|
|
23
27
|
map{|t|
|
24
28
|
tidm=t.id.gsub("_","-")
|
25
29
|
|
26
|
-
lContributes=t.contributes_to.
|
27
|
-
|
28
|
-
map{|c| cm=c.gsub("_","-"); "<a href=\"#RT-#{cm}\">\[#{c}\]</a>"}
|
30
|
+
lContributes = t.contributes_to.
|
31
|
+
map { |c| mk_hyperlink(c) }
|
29
32
|
|
30
33
|
luptraces = [uptrace_ids[t.id]].flatten.compact.map{|x| self[x]}
|
31
34
|
|
32
35
|
luptraces=luptraces.
|
33
36
|
sort_by{|x| trace_order_index(x.id)}.
|
34
37
|
map{|u|
|
35
|
-
|
36
|
-
" - <a href=\"#RT-#{um}\">[#{u.id}]</a> #{u.header_orig}"
|
38
|
+
" - #{mk_hyperlink(u.id)} #{u.header_orig}"
|
37
39
|
}
|
38
40
|
|
39
|
-
["-
|
41
|
+
["- #{mk_hyperlink(t.id)} <!-- --> <a id=\"RT-#{tidm}\"/>**#{t.header_orig}**" +
|
40
42
|
# " (#{t.contributes_to.join(', ')})", "",
|
41
43
|
" (#{lContributes.join(', ')})", "",
|
42
44
|
luptraces
|
@@ -50,7 +52,7 @@ class TraceableSet
|
|
50
52
|
all_traces(selectedCategory).
|
51
53
|
sort_by{|x| trace_order_index(x.id) }.
|
52
54
|
map{|t|
|
53
|
-
"\n\n[#{t.id}] **#{t.header_orig}** { }()"
|
55
|
+
"\n\n\\[#{t.id}\\] **#{t.header_orig}** { }()"
|
54
56
|
}.join("\n\n")
|
55
57
|
end
|
56
58
|
|
@@ -23,16 +23,16 @@ class TraceableSet
|
|
23
23
|
# @return [type] [description]
|
24
24
|
def initialize()
|
25
25
|
# the traces
|
26
|
-
@traces={}
|
26
|
+
@traces = {}
|
27
27
|
|
28
28
|
# the list of supporters
|
29
29
|
# supporters for foo 0 @@supported_by["foo"]
|
30
|
-
@supported_by={}
|
30
|
+
@supported_by = {}
|
31
31
|
|
32
32
|
|
33
33
|
# define the sort order policy
|
34
34
|
# it is the same for all slots
|
35
|
-
@sortOrder=[]
|
35
|
+
@sortOrder = []
|
36
36
|
|
37
37
|
end
|
38
38
|
|
@@ -63,7 +63,7 @@ class TraceableSet
|
|
63
63
|
# @param category [Symbol] Restrict the comparison to a particlar category
|
64
64
|
#
|
65
65
|
# @return [Array] the ids of the added traces (list of trace_id which are not in @referece_set)
|
66
|
-
def added_trace_ids(reference_set, category=nil)
|
66
|
+
def added_trace_ids(reference_set, category = nil)
|
67
67
|
self.all_trace_ids(category) - reference_set.all_trace_ids(category)
|
68
68
|
end
|
69
69
|
|
@@ -74,9 +74,9 @@ class TraceableSet
|
|
74
74
|
# @param category [Symbol] Restrict the operation to traceables of this category.
|
75
75
|
#
|
76
76
|
# @return [Array] List of trace_id which changed not in reference_set
|
77
|
-
def changed_trace_ids(reference_set, category=nil)
|
78
|
-
candidates=self.all_trace_ids(category) & reference_set.all_trace_ids(category)
|
79
|
-
candidates.map{|candidate|
|
77
|
+
def changed_trace_ids(reference_set, category = nil)
|
78
|
+
candidates = self.all_trace_ids(category) & reference_set.all_trace_ids(category)
|
79
|
+
candidates.map { |candidate|
|
80
80
|
self[candidate].get_diff(reference_set[candidate])
|
81
81
|
}.compact
|
82
82
|
end
|
@@ -87,9 +87,9 @@ class TraceableSet
|
|
87
87
|
# @param category [Symbol] Restrict the operation to traceables of this category.
|
88
88
|
#
|
89
89
|
# @return [Array] List of trace_id which unchanged
|
90
|
-
def unchanged_trace_ids(reference_set, category=nil)
|
91
|
-
candidates=self.all_trace_ids(category) & reference_set.all_trace_ids(category)
|
92
|
-
candidates.select{|candidate|
|
90
|
+
def unchanged_trace_ids(reference_set, category = nil)
|
91
|
+
candidates = self.all_trace_ids(category) & reference_set.all_trace_ids(category)
|
92
|
+
candidates.select { |candidate|
|
93
93
|
self[candidate].get_diff(reference_set[candidate]).nil?
|
94
94
|
}.compact
|
95
95
|
end
|
@@ -101,7 +101,7 @@ class TraceableSet
|
|
101
101
|
# @param category [Symbol] Restrict the operation to traceables of this category.
|
102
102
|
#
|
103
103
|
# @return [Array] List of trace_id which are deleted (not in current set)
|
104
|
-
def deleted_trace_ids(reference_set, category=nil)
|
104
|
+
def deleted_trace_ids(reference_set, category = nil)
|
105
105
|
reference_set.all_trace_ids(category) - self.all_trace_ids(category)
|
106
106
|
end
|
107
107
|
|
@@ -109,31 +109,31 @@ class TraceableSet
|
|
109
109
|
# export the trace as graphml for yed
|
110
110
|
# @return - the requirements tree in graphml
|
111
111
|
def to_graphml
|
112
|
-
f
|
112
|
+
f = File.open("#{File.dirname(__FILE__)}/../../resources/requirementsSynopsis.graphml")
|
113
113
|
doc = Nokogiri::XML(f)
|
114
114
|
f.close
|
115
115
|
|
116
|
-
graph=doc.xpath("//xmlns:graph").first
|
116
|
+
graph = doc.xpath("//xmlns:graph").first
|
117
117
|
|
118
118
|
# generate all nodes
|
119
|
-
self.all_traces(nil).each{|theTrace|
|
120
|
-
n_node
|
121
|
-
n_node["id"]
|
122
|
-
n_data
|
123
|
-
n_data["key"]= "d6"
|
124
|
-
n_ShapeNode
|
125
|
-
n_NodeLabel
|
119
|
+
self.all_traces(nil).each { |theTrace|
|
120
|
+
n_node = Nokogiri::XML::Node.new "node", doc
|
121
|
+
n_node["id"] = theTrace.id
|
122
|
+
n_data = Nokogiri::XML::Node.new "data", doc
|
123
|
+
n_data["key"] = "d6"
|
124
|
+
n_ShapeNode = Nokogiri::XML::Node.new "y:ShapeNode", doc
|
125
|
+
n_NodeLabel = Nokogiri::XML::Node.new "y:NodeLabel", doc
|
126
126
|
n_NodeLabel.content = "[#{theTrace.id}] #{theTrace.header_orig}"
|
127
127
|
n_ShapeNode << n_NodeLabel
|
128
128
|
n_data << n_ShapeNode
|
129
129
|
n_node << n_data
|
130
130
|
graph << n_node
|
131
131
|
|
132
|
-
theTrace.contributes_to.each{|up|
|
133
|
-
n_edge=Nokogiri::XML::Node.new "edge", doc
|
134
|
-
n_edge["source"
|
135
|
-
n_edge["target"
|
136
|
-
n_edge["id"
|
132
|
+
theTrace.contributes_to.each { |up|
|
133
|
+
n_edge = Nokogiri::XML::Node.new "edge", doc
|
134
|
+
n_edge["source"] = theTrace.id
|
135
|
+
n_edge["target"] = up
|
136
|
+
n_edge["id"] = "#{up}_#{theTrace.id}"
|
137
137
|
graph << n_edge
|
138
138
|
}
|
139
139
|
}
|
@@ -146,7 +146,7 @@ class TraceableSet
|
|
146
146
|
# @return [Array of String] an array of the registered Traceables
|
147
147
|
# of the selectedCategory
|
148
148
|
def all_trace_ids(selected_category = nil)
|
149
|
-
@traces.keys.select{|x|
|
149
|
+
@traces.keys.select { |x|
|
150
150
|
y = @traces[x].first
|
151
151
|
selected_category.nil? or y.category == selected_category
|
152
152
|
}.sort
|
@@ -161,7 +161,7 @@ class TraceableSet
|
|
161
161
|
#
|
162
162
|
# @return [Array of Traceable] The array of traceables
|
163
163
|
def all_traces(selected_category = nil)
|
164
|
-
all_trace_ids(selected_category).map{|t| @traces[t].first}
|
164
|
+
all_trace_ids(selected_category).map { |t| @traces[t].first }
|
165
165
|
end
|
166
166
|
|
167
167
|
|
@@ -187,43 +187,43 @@ class TraceableSet
|
|
187
187
|
# this lists duplicate traces
|
188
188
|
# @return [Array of String] the list of the id of duplicate Traces
|
189
189
|
def duplicate_ids()
|
190
|
-
@traces.select{|id, traceables| traceables.length > 1}.map{|id, traceable| id}.sort
|
190
|
+
@traces.select { |id, traceables| traceables.length > 1 }.map { |id, traceable| id }.sort
|
191
191
|
end
|
192
192
|
|
193
193
|
# this lists duplicate traces
|
194
194
|
# @return [Array of Traceable] the list duplicate Traces.
|
195
195
|
def duplicate_traces()
|
196
|
-
@traces.select{|id, traceables| traceables.length > 1}.map{|id, traceable| traceable}.sort
|
196
|
+
@traces.select { |id, traceables| traceables.length > 1 }.map { |id, traceable| traceable }.sort
|
197
197
|
end
|
198
198
|
|
199
199
|
|
200
200
|
# this serializes a particular slot for caching
|
201
201
|
# @param file [String] name of the cachefile
|
202
202
|
def dump_to_marshal(file)
|
203
|
-
File.open(file, "wb"){|f|
|
203
|
+
File.open(file, "wb") { |f|
|
204
204
|
Marshal.dump(self, f)
|
205
205
|
}
|
206
206
|
end
|
207
207
|
|
208
208
|
# this loads cached information into a particular slot
|
209
209
|
# @param file [String] name of the cachefile
|
210
|
-
def
|
211
|
-
a=nil
|
212
|
-
File.open(file, "rb"){|f| a=Marshal.load(f)}
|
210
|
+
def self.load_from_marshal(file)
|
211
|
+
a = nil
|
212
|
+
File.open(file, "rb") { |f| a = Marshal.load(f) }
|
213
213
|
a
|
214
214
|
end
|
215
215
|
|
216
216
|
# this merges a TraceableSet
|
217
217
|
# @return [Treaceable] the current traceable set
|
218
218
|
def merge(set)
|
219
|
-
set.all_traces_as_arrays.values.flatten.each{|t| self.add(t)}
|
219
|
+
set.all_traces_as_arrays.values.flatten.each { |t| self.add(t) }
|
220
220
|
end
|
221
221
|
|
222
222
|
# this retunrs traces marked as supported but not being defined
|
223
223
|
# @return [Array of String] the list of the id of undefined Traces
|
224
224
|
# traces which are marked as uptraces but do not exist.
|
225
225
|
def undefined_ids
|
226
|
-
@supported_by.keys.select{|t| not @traces.has_key?(t)}.sort
|
226
|
+
@supported_by.keys.select { |t| not @traces.has_key?(t) }.sort
|
227
227
|
end
|
228
228
|
|
229
229
|
#
|
@@ -243,7 +243,7 @@ class TraceableSet
|
|
243
243
|
# it is placed according to the sequence
|
244
244
|
# in the array. Otherwise it is sorted at the end
|
245
245
|
def sort_order= (sort_order)
|
246
|
-
@sort_order=sort_order
|
246
|
+
@sort_order = sort_order
|
247
247
|
end
|
248
248
|
|
249
249
|
# this determines the sort order index of a trace
|
@@ -252,11 +252,11 @@ class TraceableSet
|
|
252
252
|
# the sort order index shall be coumputed.
|
253
253
|
# @return [String] the sort key of the given id.
|
254
254
|
def trace_order_index(trace_id)
|
255
|
-
global
|
256
|
-
|
255
|
+
global = @sort_order.index { |x| trace_id.start_with? x } ||
|
256
|
+
(@sort_order.length + 1)
|
257
257
|
|
258
258
|
# add the {index} of the trace to
|
259
|
-
orderId = [global.to_s.rjust(5,"0"),trace_id].join("_")
|
259
|
+
orderId = [global.to_s.rjust(5, "0"), trace_id].join("_")
|
260
260
|
orderId
|
261
261
|
end
|
262
262
|
|
@@ -272,11 +272,10 @@ class TraceableSet
|
|
272
272
|
#
|
273
273
|
# @return [type] [description]
|
274
274
|
def to_compareEntries
|
275
|
-
all_traces.sort.map{|t| "\n\n[#{t.id}]\n#{t.as_oneline}" }.join("\n")
|
275
|
+
all_traces.sort.map { |t| "\n\n[#{t.id}]\n#{t.as_oneline}" }.join("\n")
|
276
276
|
end
|
277
277
|
|
278
278
|
|
279
|
-
|
280
279
|
#############################
|
281
280
|
|
282
281
|
private
|
@@ -286,7 +285,7 @@ class TraceableSet
|
|
286
285
|
# @param [Nokogiri::XML::Document] doc - the document
|
287
286
|
# @return [Nokogiri::XML::Document] the beautified document
|
288
287
|
def xp(doc)
|
289
|
-
xsl
|
288
|
+
xsl = <<-XSL
|
290
289
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
291
290
|
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
|
292
291
|
<xsl:strip-space elements="*"/>
|
@@ -307,16 +306,19 @@ class TraceableSet
|
|
307
306
|
end
|
308
307
|
|
309
308
|
|
309
|
+
class Traceable
|
310
310
|
|
311
|
+
def clear_trace_id(id)
|
312
|
+
id.gsub("\\_", "_")
|
313
|
+
end
|
311
314
|
|
312
|
-
class Traceable
|
313
315
|
include Comparable
|
314
316
|
|
315
317
|
|
316
318
|
# String: The trace-Id
|
317
|
-
|
319
|
+
attr_reader :id
|
318
320
|
# string: the alternative Id, used e.g. for the constraint number
|
319
|
-
|
321
|
+
attr_reader :alternative_id
|
320
322
|
# String: The header in plain text
|
321
323
|
attr_accessor :header_plain
|
322
324
|
# String: The header in original format
|
@@ -326,7 +328,7 @@ class Traceable
|
|
326
328
|
# String: he body in original format
|
327
329
|
attr_accessor :body_orig
|
328
330
|
# Array of Strings: The uplink as an array of Trace-ids
|
329
|
-
|
331
|
+
attr_reader :contributes_to
|
330
332
|
# String: the Traceable in its original format
|
331
333
|
attr_accessor :trace_orig
|
332
334
|
# String: origin of the entry
|
@@ -338,18 +340,30 @@ class Traceable
|
|
338
340
|
|
339
341
|
|
340
342
|
def initialize()
|
341
|
-
@id
|
343
|
+
@id = ""
|
342
344
|
@alternative_id = ""
|
343
|
-
@header_orig
|
344
|
-
@body_plain
|
345
|
-
@body_orig
|
345
|
+
@header_orig = ""
|
346
|
+
@body_plain = ""
|
347
|
+
@body_orig = ""
|
346
348
|
@contributes_to = []
|
347
|
-
@trace_orig
|
348
|
-
@category
|
349
|
-
@info
|
349
|
+
@trace_orig = ""
|
350
|
+
@category = ""
|
351
|
+
@info = ""
|
352
|
+
end
|
353
|
+
|
354
|
+
def id=(id)
|
355
|
+
@id = clear_trace_id(id)
|
356
|
+
end
|
357
|
+
|
358
|
+
def alternative_id=()
|
359
|
+
@alternative_id = clear_trace_id(id)
|
360
|
+
end
|
361
|
+
|
362
|
+
def contributes_to=(list)
|
363
|
+
@contributes_to = list.map { |id| id = clear_trace_id(id) }
|
350
364
|
end
|
351
365
|
|
352
|
-
# define the comparison to makeit really
|
366
|
+
# define the comparison to makeit really comparable
|
353
367
|
# @param [Traceable] other the other traceable for comparison.
|
354
368
|
def <=> (other)
|
355
369
|
@id <=> other.id
|
@@ -366,19 +380,19 @@ class Traceable
|
|
366
380
|
if newval == oldval
|
367
381
|
result = nil
|
368
382
|
else
|
369
|
-
diff_as_html= "<pre>#{other.trace_orig}</pre><hr/><pre>#{self.trace_orig}</pre>"#Diffy::Diff.new(other.trace_orig, self.trace_orig).to_s(:text)
|
370
|
-
rawDiff
|
371
|
-
diff_as_html=rawDiff.to_s(:html)
|
383
|
+
diff_as_html = "<pre>#{other.trace_orig}</pre><hr/><pre>#{self.trace_orig}</pre>" #Diffy::Diff.new(other.trace_orig, self.trace_orig).to_s(:text)
|
384
|
+
rawDiff = Diffy::Diff.new(self.trace_orig, other.trace_orig)
|
385
|
+
diff_as_html = rawDiff.to_s(:html)
|
372
386
|
|
373
|
-
result
|
374
|
-
diff_as_html=nil
|
387
|
+
result = [self.id, similarity, diff_as_html]
|
388
|
+
diff_as_html = nil
|
375
389
|
end
|
376
390
|
result
|
377
391
|
end
|
378
392
|
|
379
393
|
|
380
394
|
def get_comparison_string
|
381
|
-
"#{header_orig};#{body_orig};#{contributes_to.sort}".gsub(/\s+/," ")
|
395
|
+
"#{header_orig};#{body_orig};#{contributes_to.sort}".gsub(/\s+/, " ")
|
382
396
|
end
|
383
397
|
|
384
398
|
def as_oneline
|
@@ -42,7 +42,7 @@ TRACE_REF_PATTERN = /->\[(\w+_\w+_\w+)\]/
|
|
42
42
|
# pageclearance
|
43
43
|
INCLUDE_PDF_PATTERN = /^\s+~~PDF\s+"(.+)" \s+ "(.+)" \s* (\d*) \s* (\d+-\d+)? \s* (clearpage|cleardoublepage)?~~/x
|
44
44
|
|
45
|
-
INCLUDE_MD_PATTERN = /(\s*)~~MD\s
|
45
|
+
INCLUDE_MD_PATTERN = /(\s*)~~MD\s+\\?"(.+)\\?"~~/x
|
46
46
|
|
47
47
|
SNIPPET_PATTERN = /(\s*)~~SN \s+ (\w+)~~/x
|
48
48
|
|
@@ -161,19 +161,22 @@ class ReferenceTweaker
|
|
161
161
|
# @return [String] The resulting text
|
162
162
|
def replace_md_inlay(text)
|
163
163
|
text.gsub!(INCLUDE_MD_PATTERN) { |m|
|
164
|
-
|
165
|
-
|
164
|
+
infile = $2.gsub("\\_", "_")
|
165
|
+
if File.exist?(infile) then
|
166
|
+
replacetext_raw = File.open(infile, :encoding => 'bom|utf-8').read
|
166
167
|
unless $1.nil? then
|
167
|
-
leading_whitespace
|
168
|
-
leading_lines
|
169
|
-
leading_spaces
|
170
|
-
replacetext
|
168
|
+
leading_whitespace = $1.split("\n", 100)
|
169
|
+
leading_lines = leading_whitespace[0 .. -1].join("\n")
|
170
|
+
leading_spaces = leading_whitespace.last || ""
|
171
|
+
replacetext = leading_lines + replacetext_raw.gsub("\n", "\n#{leading_spaces}")
|
172
|
+
else
|
173
|
+
replacetext = replacetext_raw
|
171
174
|
end
|
172
175
|
else
|
173
|
-
replacetext=""
|
176
|
+
replacetext = ""
|
174
177
|
@log.warn("File not found: #{$2}")
|
175
178
|
end
|
176
|
-
result=replace_md_inlay(replacetext)
|
179
|
+
result = replace_md_inlay(replacetext)
|
177
180
|
result
|
178
181
|
}
|
179
182
|
text
|
@@ -450,8 +453,8 @@ class PandocBeautifier
|
|
450
453
|
def initialize(logger = nil)
|
451
454
|
|
452
455
|
@markdown_output_switches = %w{
|
453
|
-
|
454
|
-
|
456
|
+
+backtick_code_blocks
|
457
|
+
-fenced_code_blocks
|
455
458
|
+compact_definition_lists
|
456
459
|
+space_in_atx_header
|
457
460
|
+yaml_metadata_block
|
@@ -459,6 +462,7 @@ class PandocBeautifier
|
|
459
462
|
|
460
463
|
@markdown_input_switches = %w{
|
461
464
|
+smart
|
465
|
+
+backtick_code_blocks
|
462
466
|
+fenced_code_blocks
|
463
467
|
+compact_definition_lists
|
464
468
|
-space_in_atx_header
|
@@ -531,15 +535,6 @@ class PandocBeautifier
|
|
531
535
|
|
532
536
|
# tweak the quoting
|
533
537
|
if $?.success? then
|
534
|
-
# do this twice since the replacement
|
535
|
-
# does not work on e.g. 2\_3\_4\_5.
|
536
|
-
#
|
537
|
-
newdoc.gsub!(/(\w)\\_(\w)/, '\1_\2')
|
538
|
-
newdoc.gsub!(/(\w)\\_(\w)/, '\1_\2')
|
539
|
-
|
540
|
-
# fix more quoting
|
541
|
-
newdoc.gsub!('-\\>[', '->[')
|
542
|
-
|
543
538
|
# (RS_Mdc)
|
544
539
|
# TODO: fix Table width toggles sometimes
|
545
540
|
if (not olddoc == newdoc) then ##only touch the file if it is really changed
|
@@ -687,7 +682,7 @@ class PandocBeautifier
|
|
687
682
|
|
688
683
|
#now combine the input files
|
689
684
|
@log.debug("combining the input files #{inputname} et al")
|
690
|
-
cmd="#{PANDOC_EXE} --standalone -o #{output} --ascii #{inputs}" # note that inputs is already quoted
|
685
|
+
cmd="#{PANDOC_EXE} -f markdown#{@markdown_input_switches} --standalone -t markdown#{@markdown_output_switches} -o #{output} --ascii #{inputs}" # note that inputs is already quoted
|
691
686
|
system(cmd)
|
692
687
|
if $?.success? then
|
693
688
|
PandocBeautifier.new().beautify(output)
|
@@ -959,7 +954,7 @@ class PandocBeautifier
|
|
959
954
|
begin
|
960
955
|
vars_string=vars.map.map { |key, value| "-V #{key}=#{value.esc}" }.join(" ")
|
961
956
|
rescue
|
962
|
-
|
957
|
+
#todo require 'pry'; binding.pry
|
963
958
|
end
|
964
959
|
|
965
960
|
@log.info("rendering #{outname} as [#{format.join(', ')}]")
|
@@ -1057,7 +1052,6 @@ class PandocBeautifier
|
|
1057
1052
|
|
1058
1053
|
cmd="#{PANDOC_EXE} -f markdown#{@markdown_input_switches} #{tempfileHtml.esc} --toc --standalone --self-contained --ascii --number-sections #{vars_string}" +
|
1059
1054
|
" -t plain+smart -o #{outfileText.esc}"
|
1060
|
-
puts cmd
|
1061
1055
|
`#{cmd}`
|
1062
1056
|
end
|
1063
1057
|
|
@@ -25,12 +25,12 @@ grammar TraceInMarkdown
|
|
25
25
|
end
|
26
26
|
|
27
27
|
rule traceId
|
28
|
-
"[" payload:label "]"
|
28
|
+
("[" / "\\[") payload:label ("]" / "\\]")
|
29
29
|
end
|
30
30
|
|
31
31
|
|
32
32
|
rule label
|
33
|
-
[a-zA-Z]+ "_" [a-zA-Z]+ "_" [0-9]+
|
33
|
+
[a-zA-Z]+ ("_" / "\\_") [a-zA-Z]+ ("_" / "\\_") [0-9]+
|
34
34
|
end
|
35
35
|
|
36
36
|
rule traceHead
|
data/lib/wortsammler/version.rb
CHANGED
@@ -1,7 +1,4 @@
|
|
1
1
|
- this is headline
|
2
|
-
- this is TC_EXP_003_1
|
3
|
-
- this is md TC_EXP_003_2
|
4
|
-
- this is md TC_EXP_003_2
|
5
2
|
|
6
3
|
|
7
4
|
|
@@ -9,31 +6,21 @@ THIS IS HEADLINE
|
|
9
6
|
|
10
7
|
|
11
8
|
|
12
|
-
now verbatim by indent inclucde TC_EXP_003_1.md
|
9
|
+
now verbatim by indent inclucde TC_EXP_003_1.md## this is TC_EXP_003_1
|
13
10
|
|
14
|
-
|
15
|
-
|
16
|
-
we now include TC_EXP_003_2 from TC_EXP_003_1
|
17
|
-
|
18
|
-
## this is md TC_EXP_003_2
|
19
|
-
|
20
|
-
- hugo
|
21
|
-
|
22
|
-
- hugo2
|
23
|
-
|
24
|
-
end of TC_EXP_003_2
|
25
|
-
|
26
|
-
end of TC_EXP_003_1
|
11
|
+
we now include TC_EXP_003_2 from TC_EXP_003_1## this is md TC_EXP_003_2
|
27
12
|
|
28
|
-
|
13
|
+
- hugo
|
29
14
|
|
15
|
+
- hugo2
|
30
16
|
|
31
|
-
|
17
|
+
end of TC_EXP_003_2
|
32
18
|
|
33
|
-
|
19
|
+
end of TC_EXP_003_1
|
34
20
|
|
21
|
+
now full format inclucde TC_EXP_003_1.md## this is TC_EXP_003_1
|
35
22
|
|
36
|
-
this is md TC_EXP_003_2
|
23
|
+
we now include TC_EXP_003_2 from TC_EXP_003_1## this is md TC_EXP_003_2
|
37
24
|
|
38
25
|
- hugo
|
39
26
|
|
@@ -43,10 +30,7 @@ end of TC_EXP_003_2
|
|
43
30
|
|
44
31
|
end of TC_EXP_003_1
|
45
32
|
|
46
|
-
now full format inclucde TC_EXP_003_2.md
|
47
|
-
|
48
|
-
|
49
|
-
this is md TC_EXP_003_2
|
33
|
+
now full format inclucde TC_EXP_003_2.md## this is md TC_EXP_003_2
|
50
34
|
|
51
35
|
- hugo
|
52
36
|
|
data/spec/test_beautify.md
CHANGED
@@ -27,3 +27,16 @@ this
|
|
27
27
|
|
28
28
|
codedblock
|
29
29
|
```
|
30
|
+
|
31
|
+
|
32
|
+
**QNAP Store** **iSCSI-Name**
|
33
|
+
---------------- ------------------------ -------------------------------------------------
|
34
|
+
**KTLStore3** ktlstore3target1\_lun0 altes Replica-Volumen für KTLAZ-Host1
|
35
|
+
ktlstore3target2\_lun0 Hauptspeichervolumen (Laufwerk D auf KTLHost3)
|
36
|
+
ktlstore3excvol1 Speicher für Exchange (Laufwerk E auf KTLHost3)
|
37
|
+
ktlstore3excvol2 Speicher für Exchange (Laufwerk F auf KTLHost3)
|
38
|
+
**KTLStore4** ktlstore4target1\_lun0 1,5 TB Volume auf
|
39
|
+
ktlstore4target2\_lun0 Hauptspeichervolumen für KTLHost4 Laufwerk D
|
40
|
+
ktlstore4excvol1 Speicher für Exchange (Laufwerk E auf KTLHost4)
|
41
|
+
ktlstore4excvol2 Speicher für Exchange (Laufwerk F auf KTLHost4)
|
42
|
+
|
@@ -28,3 +28,14 @@ this
|
|
28
28
|
|
29
29
|
codedblock
|
30
30
|
~~~~
|
31
|
+
|
32
|
+
**QNAP Store** **iSCSI-Name**
|
33
|
+
---------------- ------------------------ -------------------------------------------------
|
34
|
+
**KTLStore3** ktlstore3target1\_lun0 altes Replica-Volumen für KTLAZ-Host1
|
35
|
+
ktlstore3target2\_lun0 Hauptspeichervolumen (Laufwerk D auf KTLHost3)
|
36
|
+
ktlstore3excvol1 Speicher für Exchange (Laufwerk E auf KTLHost3)
|
37
|
+
ktlstore3excvol2 Speicher für Exchange (Laufwerk F auf KTLHost3)
|
38
|
+
**KTLStore4** ktlstore4target1\_lun0 1,5 TB Volume auf
|
39
|
+
ktlstore4target2\_lun0 Hauptspeichervolumen für KTLHost4 Laufwerk D
|
40
|
+
ktlstore4excvol1 Speicher für Exchange (Laufwerk E auf KTLHost4)
|
41
|
+
ktlstore4excvol2 Speicher für Exchange (Laufwerk F auf KTLHost4)
|