wortsammler 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +10 -6
- data/changelog.md +13 -3
- data/lib/wortsammler/class.proolib.rb +1 -1
- data/lib/wortsammler/version.rb +1 -1
- data/resources/wortsammler.sty +57 -0
- data/spec/test_beautify.md +30 -0
- data/spec/test_beautify_reference.md +27 -0
- data/spec/test_mkindex_reference.txt +89 -0
- data/spec/wortsammler_spec.rb +95 -76
- data/testresults/wortsammler_testresults.html +269 -132
- data/testresults/wortsammler_testresults.log +122 -6
- data/wortsammler.gemspec +3 -3
- metadata +45 -69
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7a1e3f537701bd5ec6b1635756227f857821fe64
|
4
|
+
data.tar.gz: 3cd97246f3e644f41cbbbd195f27a660f2d3cdbe
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 642b107ccca1b89ca1d1d686a19b4404757c13cd5e696bf5e372cbecd9a2ee85b441d0c4b0dc10ab77607add9a4545bb7652008caa115351f78fac4808ff5d42
|
7
|
+
data.tar.gz: 8d8c2d28240c22ea1cacaaafe890d8beae8902a7b417a95c2fde2a2dda4f35544c3e14a07c5790de4b643460efd3f129af95707874b5c0e0c60f0f3e19bf6e2a
|
data/README.md
CHANGED
@@ -64,25 +64,25 @@ In order to use Wortsammler, you need to install the prerequisites:
|
|
64
64
|
|
65
65
|
### display the options
|
66
66
|
|
67
|
-
|
67
|
+
wortsammler -h
|
68
68
|
|
69
69
|
### process markdown files
|
70
70
|
|
71
|
-
|
71
|
+
wortsammler -pi readme.md -o.
|
72
72
|
-- generates readme.pdf
|
73
73
|
|
74
|
-
|
74
|
+
wortsammler -pi readme.md -f pdf:docx:html -o.
|
75
75
|
-- generates readme.pdf, readme.html, readme.docx
|
76
76
|
|
77
|
-
|
77
|
+
wortsammler -bi readme.md
|
78
78
|
-- beautifies readme.md (normalizes the markdown)
|
79
79
|
|
80
|
-
|
80
|
+
wortsammler -bi .
|
81
81
|
-- recursively beautifies all markdown files in the current folder
|
82
82
|
|
83
83
|
### initialize a project
|
84
84
|
|
85
|
-
|
85
|
+
wortsammler init <folder>
|
86
86
|
|
87
87
|
This command generates the proposed directory structure, a first
|
88
88
|
document manifest and a rake file to do the processing.
|
@@ -126,6 +126,10 @@ The rakefile is in `<folder>/30_Sources/ZSUPP_Tools`
|
|
126
126
|
6. Push to the branch (`git push origin my-new-feature`)
|
127
127
|
7. Create new Pull Request
|
128
128
|
|
129
|
+
## License
|
130
|
+
|
131
|
+
MIT: http://www.opensource.org/licenses/mit-license.php
|
132
|
+
|
129
133
|
## thanks to
|
130
134
|
|
131
135
|
- John Mc Farlane for [pandoc][]
|
data/changelog.md
CHANGED
@@ -1,11 +1,21 @@
|
|
1
|
+
# 0.1.0 (24.12.2014)
|
2
|
+
|
3
|
+
- adapt to pandoc 1.13
|
4
|
+
- add slide output formats
|
5
|
+
- improved installation of Wortsammler Box here
|
6
|
+
- improve installation of the required executeables
|
7
|
+
|
1
8
|
# 0.0.9 (26.08.2013)
|
2
9
|
|
3
|
-
- Fixed encoding while reading traces from markdown
|
10
|
+
- Fixed encoding while reading traces from markdown
|
11
|
+
(https://github.com/bwl21/wortsammler/issues/23)
|
4
12
|
|
5
13
|
# 0.0.8 (26.08.2013)
|
6
14
|
|
7
|
-
- Added support for handling test specifications
|
8
|
-
|
15
|
+
- Added support for handling test specifications
|
16
|
+
(https://github.com/bwl21/wortsammler/issues/22)
|
17
|
+
- Fixed some encoding issues
|
18
|
+
(https://github.com/bwl21/wortsammler/issues/21)
|
9
19
|
|
10
20
|
# 0.0.7 (17.07.2013)
|
11
21
|
|
@@ -484,7 +484,7 @@ class PandocBeautifier
|
|
484
484
|
docfile.close
|
485
485
|
|
486
486
|
# process the file in pandoc
|
487
|
-
cmd="pandoc -s #{file.esc} -f markdown -t markdown --atx-headers
|
487
|
+
cmd="pandoc -s #{file.esc} -f markdown -t markdown --atx-headers "
|
488
488
|
newdoc = `#{cmd}`
|
489
489
|
@log.debug "beautify #{file.esc}: #{$?}"
|
490
490
|
@log.debug(" finished: \"#{file}\"")
|
data/lib/wortsammler/version.rb
CHANGED
@@ -0,0 +1,57 @@
|
|
1
|
+
% this is part of wortsammler (https://github.com/bwl21/wortsammler)
|
2
|
+
% it contains wortsammler specific settings and commands
|
3
|
+
%
|
4
|
+
% usage: usepackage{wortsammler}
|
5
|
+
%
|
6
|
+
%
|
7
|
+
%
|
8
|
+
%list environment by reinhard Jahraus
|
9
|
+
{\catcode`\@=11\relax%
|
10
|
+
\gdef\itemize{%
|
11
|
+
\ifnum \@itemdepth >\thr@@\@toodeep\else
|
12
|
+
\advance\@itemdepth\@ne
|
13
|
+
\edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
|
14
|
+
\expandafter
|
15
|
+
\list
|
16
|
+
\csname\@itemitem\endcsname
|
17
|
+
{\def\makelabel##1{\hss\llap{##1}}%
|
18
|
+
\addtolength{\leftmargin}{-10pt}% 29.37pt
|
19
|
+
\addtolength{\rightmargin}{0.0pt}% 0.0pt
|
20
|
+
\addtolength{\labelsep}{0pt}% 23.50pt
|
21
|
+
\addtolength{\itemsep}{-3.0pt}% 5.0pt
|
22
|
+
\addtolength{\parsep}{-1pt}% 5.0pt
|
23
|
+
\addtolength{\topsep}{-5pt}% 10.0pt
|
24
|
+
\addtolength{\partopsep}{0pt}% 3.0pt
|
25
|
+
}%
|
26
|
+
\fi}
|
27
|
+
}%
|
28
|
+
%
|
29
|
+
% We will generate all images so they have a width \maxwidth. This means
|
30
|
+
% that they will get their normal width if they fit onto the page, but
|
31
|
+
% are scaled down if they would overflow the margins.
|
32
|
+
\makeatletter
|
33
|
+
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth
|
34
|
+
\else\Gin@nat@width\fi}
|
35
|
+
\makeatother
|
36
|
+
\let\Oldincludegraphics\includegraphics
|
37
|
+
\makeatletter
|
38
|
+
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth
|
39
|
+
\else\Gin@nat@width\fi}
|
40
|
+
\makeatother
|
41
|
+
\let\Oldincludegraphics\includegraphics
|
42
|
+
%\renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}}
|
43
|
+
% Determine if the image is too wide for the page.
|
44
|
+
%
|
45
|
+
{%
|
46
|
+
\catcode`\@=11\relax%
|
47
|
+
\gdef\includegraphics{\@ifnextchar[{\Oldincludegraphics}{\Oldincludegraphics[width=\maxwidth]}}%
|
48
|
+
}%
|
49
|
+
%
|
50
|
+
%
|
51
|
+
% required for embeded icons
|
52
|
+
\usepackage{multicol}
|
53
|
+
\usepackage{wrapfig}
|
54
|
+
\usepackage{needspace}
|
55
|
+
|
56
|
+
|
57
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
% Test Markdown
|
2
|
+
% Bernhard Weichel
|
3
|
+
% 1.12.2014
|
4
|
+
|
5
|
+
# Test headlines
|
6
|
+
|
7
|
+
Head Leel 2
|
8
|
+
===========
|
9
|
+
|
10
|
+
# test fenced code blocks
|
11
|
+
|
12
|
+
~~~~ {#codeblock}
|
13
|
+
|
14
|
+
this
|
15
|
+
|
16
|
+
is
|
17
|
+
|
18
|
+
codedblock
|
19
|
+
~~~~
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
``` {#backtick_codeblock}
|
24
|
+
|
25
|
+
this
|
26
|
+
|
27
|
+
is
|
28
|
+
|
29
|
+
codedblock
|
30
|
+
```
|
@@ -0,0 +1,27 @@
|
|
1
|
+
% Test Markdown
|
2
|
+
% Bernhard Weichel
|
3
|
+
% 1.12.2014
|
4
|
+
|
5
|
+
# Test headlines
|
6
|
+
|
7
|
+
# Head Leel 2
|
8
|
+
|
9
|
+
# test fenced code blocks
|
10
|
+
|
11
|
+
~~~~ {#codeblock}
|
12
|
+
|
13
|
+
this
|
14
|
+
|
15
|
+
is
|
16
|
+
|
17
|
+
codedblock
|
18
|
+
~~~~
|
19
|
+
|
20
|
+
~~~~ {#backtick_codeblock}
|
21
|
+
|
22
|
+
this
|
23
|
+
|
24
|
+
is
|
25
|
+
|
26
|
+
codedblock
|
27
|
+
~~~~
|
@@ -0,0 +1,89 @@
|
|
1
|
+
CONTENTS
|
2
|
+
|
3
|
+
CONTENTS
|
4
|
+
|
5
|
+
Contents
|
6
|
+
1 Das ist ein Test zur Indexerstellung
|
7
|
+
|
8
|
+
2
|
9
|
+
|
10
|
+
1
|
11
|
+
|
12
|
+
December 17, 2014
|
13
|
+
|
14
|
+
1
|
15
|
+
|
16
|
+
DAS IST EIN TEST ZUR INDEXERSTELLUNG
|
17
|
+
|
18
|
+
1 Das ist ein Test zur Indexerstellung
|
19
|
+
Dies ist ein Typoblindtext. An ihm kann man sehen, ob alle Buchstaben da sind und wie sie aussehen. Manchmal
|
20
|
+
benutzt man Worte wie Hamburgefonts, Rafgenduks oder Handgloves, um Schriften zu testen.
|
21
|
+
Manchmal Sätze, die alle Buchstaben des Alphabets enthalten - man nennt diese Sätze »Pangrams«. Sehr bekannt
|
22
|
+
ist dieser: The quick brown fox jumps over the lazy old dog. Oft werden in Typoblindtexte auch fremdsprachige
|
23
|
+
Satzteile eingebaut (AVAIL® and Wefox™ are testing aussi la Kerning), um die Wirkung in anderen Sprachen zu
|
24
|
+
testen. In Lateinisch sieht zum Beispiel fast jede Schrift gut aus. Quod erat demonstrandum. Seit 1975 fehlen in
|
25
|
+
den meisten Testtexten die Zahlen, weswegen nach TypoGb. 204 § ab dem Jahr 2034 Zahlen in 86 der Texte zur
|
26
|
+
Pflicht werden. Nichteinhaltung wird mit bis zu 245 € oder 368 $ bestraft. Genauso wichtig in sind mittlerweile auch
|
27
|
+
Âçcèñtë, die in neueren Schriften aber fast immer enthalten sind. Ein wichtiges aber schwierig zu integrierendes Feld
|
28
|
+
sind OpenType-Funktionalitäten. Je nach Software und Voreinstellungen können eingebaute Kapitälchen, Kerning
|
29
|
+
oder Ligaturen (sehr pfiffig) nicht richtig dargestellt werden.Dies ist ein Typoblindtext. An ihm kann man sehen, ob
|
30
|
+
alle Buchstaben da sind und wie sie aussehen. Manchmal benutzt man Worte wie Hamburgefonts, Rafgenduks
|
31
|
+
|
32
|
+
2
|
33
|
+
|
34
|
+
December 17, 2014
|
35
|
+
|
36
|
+
1 DAS IST EIN TEST ZUR INDEXERSTELLUNG
|
37
|
+
|
38
|
+
1
|
39
|
+
|
40
|
+
DAS IST EIN TEST ZUR INDEXERSTELLUNG
|
41
|
+
|
42
|
+
Dies ist ein Typoblindtext. An ihm kann man sehen, ob alle Buchstaben da sind und wie sie aussehen. Manchmal
|
43
|
+
benutzt man Worte wie Hamburgefonts, Rafgenduks oder Handgloves, um Schriften zu testen. Manchmal Sätze,
|
44
|
+
die alle Buchstaben des Alphabets enthalten - man nennt diese Sätze »Pangrams«. Sehr bekannt ist dieser: The
|
45
|
+
quick brown fox jumps over the lazy old dog. Oft werden in Typoblindtexte auch fremdsprachige Satzteile eingebaut
|
46
|
+
(AVAIL® and Wefox™ are testing aussi la Kerning), um die Wirkung in anderen Sprachen zu testen. In Lateinisch sieht
|
47
|
+
zum Beispiel fast jede Schrift gut aus. Quod erat demonstrandum. Seit 1975 fehlen in den meisten Testtexten die
|
48
|
+
Zahlen, weswegen nach TypoGb. 204 § ab dem Jahr 2034 Zahlen in 86 der Texte zur Pflicht werden. Nichteinhaltung
|
49
|
+
wird mit bis zu 245 € oder 368 $ bestraft. Genauso wichtig in sind mittlerweile auch Âçcèñtë, die in neueren Schriften
|
50
|
+
aber fast immer enthalten sind. Ein wichtiges aber schwierig zu integrierendes Feld sind OpenType-Funktionalitäten.
|
51
|
+
Je nach Software und Voreinstellungen können eingebaute Kapitälchen, Kerning oder Ligaturen (sehr pfiffig) nicht
|
52
|
+
richtig dargestellt werden.Dies ist ein Typoblindtext. An ihm kann man sehen, ob alle Buchstaben da sind und wie
|
53
|
+
sie aussehen. Manchmal benutzt man Worte wie Hamburgefonts, Rafgenduks
|
54
|
+
|
55
|
+
3
|
56
|
+
|
57
|
+
December 17, 2014
|
58
|
+
|
59
|
+
1
|
60
|
+
|
61
|
+
DAS IST EIN TEST ZUR INDEXERSTELLUNG
|
62
|
+
|
63
|
+
hier kommt der Index
|
64
|
+
|
65
|
+
4
|
66
|
+
|
67
|
+
December 17, 2014
|
68
|
+
|
69
|
+
Index
|
70
|
+
Sätze, 2
|
71
|
+
Typoblindtext, 2, 3
|
72
|
+
Uder, 2
|
73
|
+
Ufer, 2
|
74
|
+
Äpfelchen, 2
|
75
|
+
Über, 2
|
76
|
+
|
77
|
+
5
|
78
|
+
|
79
|
+
INDEX
|
80
|
+
|
81
|
+
INDEX
|
82
|
+
|
83
|
+
ende des Index
|
84
|
+
|
85
|
+
6
|
86
|
+
|
87
|
+
December 17, 2014
|
88
|
+
|
89
|
+
|
data/spec/wortsammler_spec.rb
CHANGED
@@ -3,10 +3,10 @@ require 'tmpdir'
|
|
3
3
|
require 'pry'
|
4
4
|
|
5
5
|
wortsammlerbin = "'#{File.expand_path("bin")}'"
|
6
|
-
wortsammler
|
6
|
+
wortsammler = "'#{File.expand_path(File.join("bin", "wortsammler"))}'"
|
7
7
|
testprojectdir = "testproject/30_Sources"
|
8
|
-
specdir
|
9
|
-
testoutput
|
8
|
+
specdir = File.dirname(__FILE__)
|
9
|
+
testoutput = "#{specdir}/../testoutput"
|
10
10
|
|
11
11
|
|
12
12
|
describe "Wortsammler generic issues" do
|
@@ -22,14 +22,14 @@ describe "Wortsammler generic issues" do
|
|
22
22
|
result.empty?.should==true
|
23
23
|
end
|
24
24
|
|
25
|
-
it "reports version numbers", :exp => false do
|
25
|
+
it "reports version numbers", :exp => false do
|
26
26
|
result = `#{wortsammler} -v`
|
27
27
|
result.should include "wortsammler"
|
28
28
|
result.should include "pandoc"
|
29
29
|
result.should include "XeTeX"
|
30
30
|
end
|
31
31
|
|
32
|
-
it "turns on vervbose mode", :exp => false do
|
32
|
+
it "turns on vervbose mode", :exp => false do
|
33
33
|
result = `#{wortsammler} -v`
|
34
34
|
result.should include "DEBUG"
|
35
35
|
end
|
@@ -71,14 +71,14 @@ describe "Wortsammler beautifier features" do
|
|
71
71
|
mdtext="#this is headline\n\n lorem ipsum\n\nbla fasel"
|
72
72
|
|
73
73
|
cycles=10
|
74
|
-
cycles.times{|i|
|
75
|
-
File.open("#{tempdir}/#{i}.md", "w"){|f|f.puts mdtext}
|
74
|
+
cycles.times { |i|
|
75
|
+
File.open("#{tempdir}/#{i}.md", "w") { |f| f.puts mdtext }
|
76
76
|
}
|
77
77
|
|
78
78
|
system "#{wortsammler} -bi #{tempdir}"
|
79
79
|
$?.success?.should==true
|
80
80
|
|
81
|
-
cycles.times{|i|
|
81
|
+
cycles.times { |i|
|
82
82
|
beautified_result=File.open("#{tempdir}/#{i}.md").readlines.join
|
83
83
|
beautified_result.should include("# this is headline")
|
84
84
|
}
|
@@ -90,7 +90,7 @@ describe "Wortsammler beautifier features" do
|
|
90
90
|
mdfile="#{tempdir}/single.md"
|
91
91
|
mdtext="#this is headline\n\n lorem ipsum\n\nbla fasel"
|
92
92
|
|
93
|
-
File.open(mdfile, "w"){|f|f.puts mdtext}
|
93
|
+
File.open(mdfile, "w") { |f| f.puts mdtext }
|
94
94
|
system "#{wortsammler} -bi #{mdfile}"
|
95
95
|
$?.success?.should==true
|
96
96
|
|
@@ -99,7 +99,7 @@ describe "Wortsammler beautifier features" do
|
|
99
99
|
end
|
100
100
|
|
101
101
|
it "recognizes if the specified manifest file is a directory", exp: false do
|
102
|
-
FileUtils.cd("testproject/30_Sources/ZSUPP_Tools") {|d|
|
102
|
+
FileUtils.cd("testproject/30_Sources/ZSUPP_Tools") { |d|
|
103
103
|
manifest="../ZSUPP_Manifests"
|
104
104
|
cmd= "#{wortsammler} -bm #{manifest} 2>&1"
|
105
105
|
r=`#{cmd}`
|
@@ -108,9 +108,9 @@ describe "Wortsammler beautifier features" do
|
|
108
108
|
$?.success?.should==false
|
109
109
|
end
|
110
110
|
it "beautifies input files in a manifest" do
|
111
|
-
FileUtils.cd("testproject/30_Sources/ZSUPP_Tools") {|d|
|
112
|
-
manifest="../ZSUPP_Manifests/sample_the-sample-document.yaml"
|
113
|
-
cmd= "#{wortsammler} -bm #{manifest}"
|
111
|
+
FileUtils.cd("testproject/30_Sources/ZSUPP_Tools") { |d|
|
112
|
+
manifest = "../ZSUPP_Manifests/sample_the-sample-document.yaml"
|
113
|
+
cmd = "#{wortsammler} -bm #{manifest}"
|
114
114
|
system cmd
|
115
115
|
}
|
116
116
|
$?.success?.should==true
|
@@ -127,6 +127,21 @@ describe "Wortsammler beautifier features" do
|
|
127
127
|
$?.success?.should == false
|
128
128
|
end
|
129
129
|
|
130
|
+
it "creates a semantically unchanged markdown file", exp: false do
|
131
|
+
testname = 'test_beautify'
|
132
|
+
inputfile = %Q{#{specdir}/#{testname}.md}
|
133
|
+
outputfile = %Q{#{testoutput}/#{testname}.md}
|
134
|
+
referencefile = %Q{#{specdir}/#{testname}_reference.md}
|
135
|
+
|
136
|
+
FileUtils.cp(inputfile, outputfile)
|
137
|
+
cmd = "#{wortsammler} -bi '#{outputfile}'"
|
138
|
+
system cmd
|
139
|
+
|
140
|
+
reference = File.open(referencefile).read
|
141
|
+
result = File.open(outputfile).read
|
142
|
+
result.should == reference
|
143
|
+
end
|
144
|
+
|
130
145
|
end
|
131
146
|
|
132
147
|
describe "Wortsammler conversion" do
|
@@ -135,33 +150,33 @@ describe "Wortsammler conversion" do
|
|
135
150
|
tempdir=Dir.mktmpdir
|
136
151
|
mdfile="#{tempdir}/single.md"
|
137
152
|
mdtext="#this is headline\n\n lorem ipsum\n\nbla fasel"
|
138
|
-
File.open(mdfile, "w"){|f| f.puts mdtext}
|
153
|
+
File.open(mdfile, "w") { |f| f.puts mdtext }
|
139
154
|
system "#{wortsammler} -pi #{mdfile} -o #{tempdir} -f latex:pdf:html:docx"
|
140
155
|
$?.success?.should==true
|
141
156
|
|
142
157
|
|
143
|
-
Dir["#{tempdir}/*"].map{|f|File.basename(f)}.should== ["single.docx",
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
158
|
+
Dir["#{tempdir}/*"].map { |f| File.basename(f) }.should== ["single.docx",
|
159
|
+
"single.html",
|
160
|
+
"single.latex",
|
161
|
+
"single.log",
|
162
|
+
"single.md",
|
163
|
+
"single.pdf"
|
164
|
+
]
|
150
165
|
end
|
151
166
|
|
152
167
|
it "converts a single file to default output format" do
|
153
168
|
tempdir=Dir.mktmpdir
|
154
169
|
mdfile="#{tempdir}/single.md"
|
155
170
|
mdtext="#this is headline\n\n lorem ipsum\n\nbla fasel"
|
156
|
-
File.open(mdfile, "w"){|f| f.puts mdtext}
|
171
|
+
File.open(mdfile, "w") { |f| f.puts mdtext }
|
157
172
|
system "#{wortsammler} -pi #{mdfile} -o #{tempdir}"
|
158
173
|
$?.success?.should==true
|
159
174
|
|
160
175
|
|
161
|
-
Dir["#{tempdir}/*"].map{|f|File.basename(f)}.should== ["single.log",
|
162
|
-
|
163
|
-
|
164
|
-
|
176
|
+
Dir["#{tempdir}/*"].map { |f| File.basename(f) }.should== ["single.log",
|
177
|
+
"single.md",
|
178
|
+
"single.pdf"
|
179
|
+
]
|
165
180
|
end
|
166
181
|
|
167
182
|
|
@@ -169,18 +184,21 @@ describe "Wortsammler conversion" do
|
|
169
184
|
tempdir="#{specdir}/../testoutput"
|
170
185
|
mdfile="#{tempdir}/chapternesting.md"
|
171
186
|
mdtext="#this is headline\n\n lorem ipsum\n\nbla fasel"
|
187
|
+
|
172
188
|
def lorem(j)
|
173
|
-
(1.upto 100)
|
189
|
+
(1.upto 100).map { |i| "text_#{j} lorem ipsum #{i} dolor " }.join(" ")
|
174
190
|
end
|
191
|
+
|
175
192
|
def chapter(i, depth)
|
176
193
|
["\n\n", "##########"[1..depth], " this is example on level #{i} .. #{depth}\n\n",
|
177
194
|
lorem(i),
|
178
|
-
|
195
|
+
].join("")
|
179
196
|
end
|
180
|
-
|
197
|
+
|
198
|
+
File.open(mdfile, "w") { |f|
|
181
199
|
1.upto 10 do |i|
|
182
200
|
1.upto 6 do |j|
|
183
|
-
f.puts chapter(i,j)
|
201
|
+
f.puts chapter(i, j)
|
184
202
|
end
|
185
203
|
end
|
186
204
|
}
|
@@ -188,27 +206,30 @@ describe "Wortsammler conversion" do
|
|
188
206
|
system "#{wortsammler} -pbi '#{mdfile}' -o '#{tempdir}' -f pdf:latex"
|
189
207
|
$?.success?.should==true
|
190
208
|
|
191
|
-
Dir["#{tempdir}/chapternesting*"].map{|f|File.basename(f)}.sort.should== ["chapternesting.md",
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
209
|
+
Dir["#{tempdir}/chapternesting*"].map { |f| File.basename(f) }.sort.should== ["chapternesting.md",
|
210
|
+
"chapternesting.pdf",
|
211
|
+
"chapternesting.latex",
|
212
|
+
"chapternesting.log",
|
213
|
+
"chapternesting.md.bak"
|
214
|
+
].sort
|
197
215
|
end
|
198
216
|
|
199
217
|
it "handles lists up to 9 levels", exp: false do
|
200
218
|
tempdir="#{specdir}/../testoutput"
|
201
219
|
mdfile="#{tempdir}/listnesting.md"
|
202
220
|
mdtext="#this is headline\n\n lorem ipsum\n\nbla fasel"
|
221
|
+
|
203
222
|
def lorem(j)
|
204
|
-
(1.upto 100)
|
223
|
+
(1.upto 100).map { |i| "text_#{j} lorem ipsum #{i} dolor " }.join(" ")
|
205
224
|
end
|
225
|
+
|
206
226
|
def chapter(i, depth)
|
207
227
|
["\n\n", "##########"[1..depth], " this is example on level #{i} .. #{depth}\n\n",
|
208
228
|
lorem(i),
|
209
|
-
|
229
|
+
].join("")
|
210
230
|
end
|
211
|
-
|
231
|
+
|
232
|
+
File.open(mdfile, "w") { |f|
|
212
233
|
f.puts "# depth test for lists"
|
213
234
|
f.puts ""
|
214
235
|
f.puts lorem(1)
|
@@ -222,32 +243,32 @@ describe "Wortsammler conversion" do
|
|
222
243
|
system "#{wortsammler} -pbi '#{mdfile}' -o '#{tempdir}' -f pdf:latex"
|
223
244
|
$?.success?.should==true
|
224
245
|
|
225
|
-
Dir["#{tempdir}/listnesting*"].map{|f|File.basename(f)}.sort.should== ["listnesting.md",
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
246
|
+
Dir["#{tempdir}/listnesting*"].map { |f| File.basename(f) }.sort.should== ["listnesting.md",
|
247
|
+
"listnesting.pdf",
|
248
|
+
"listnesting.latex",
|
249
|
+
"listnesting.log",
|
250
|
+
"listnesting.md.bak"
|
251
|
+
].sort
|
231
252
|
end
|
232
253
|
|
233
254
|
it "converts all files within a folder to output format" do
|
234
255
|
tempdir=Dir.mktmpdir
|
235
256
|
mdtext="# Header\n\n lorem ipsum\n"
|
236
257
|
basefiles = ["f1", "f2", "f3"]
|
237
|
-
outfiles
|
238
|
-
basefiles.each{|f|
|
239
|
-
File.open("#{tempdir}/#{f}.md", "w"){|fo|fo.puts mdtext}
|
258
|
+
outfiles = basefiles.map { |f| ["#{f}.md", "#{f}.latex"] }.flatten.sort
|
259
|
+
basefiles.each { |f|
|
260
|
+
File.open("#{tempdir}/#{f}.md", "w") { |fo| fo.puts mdtext }
|
240
261
|
}
|
241
262
|
|
242
263
|
system "#{wortsammler} -pi #{tempdir} -o #{tempdir} -f latex"
|
243
264
|
$?.success?.should==true
|
244
265
|
|
245
|
-
Dir["#{tempdir}/*"].map{|f|File.basename(f)}.sort.should== outfiles
|
266
|
+
Dir["#{tempdir}/*"].map { |f| File.basename(f) }.sort.should== outfiles
|
246
267
|
|
247
268
|
end
|
248
269
|
|
249
270
|
it "processes a manifest" do
|
250
|
-
FileUtils.cd("testproject/30_Sources/ZSUPP_Tools") {|d|
|
271
|
+
FileUtils.cd("testproject/30_Sources/ZSUPP_Tools") { |d|
|
251
272
|
manifest="../ZSUPP_Manifests/sample_the-sample-document.yaml"
|
252
273
|
cmd= "#{wortsammler} -pm #{manifest}"
|
253
274
|
system cmd
|
@@ -261,7 +282,7 @@ describe "Wortsammler conversion" do
|
|
261
282
|
$?.success?.should==false
|
262
283
|
end
|
263
284
|
|
264
|
-
it "extracts the traceables according to a manifest", :exp=> false do
|
285
|
+
it "extracts the traceables according to a manifest", :exp => false do
|
265
286
|
manifest="testproject/30_Sources/ZSUPP_Manifests/sample_the-sample-document.yaml"
|
266
287
|
system "#{wortsammler} -cm #{manifest}"
|
267
288
|
$?.success?.should==true
|
@@ -290,7 +311,6 @@ describe "Wortsammler conversion" do
|
|
290
311
|
File.exist?(outfile).should==true
|
291
312
|
end
|
292
313
|
|
293
|
-
|
294
314
|
|
295
315
|
it "processes snippets" do
|
296
316
|
pending "Test not yet implemented"
|
@@ -301,9 +321,8 @@ describe "Wortsammler conversion" do
|
|
301
321
|
end
|
302
322
|
|
303
323
|
|
304
|
-
|
305
324
|
it "runs the rake file in the sample document" do
|
306
|
-
FileUtils.cd("testproject/30_Sources/ZSUPP_Tools") {|d|
|
325
|
+
FileUtils.cd("testproject/30_Sources/ZSUPP_Tools") { |d|
|
307
326
|
path=ENV['PATH']
|
308
327
|
ENV['PATH']="#{wortsammlerbin}:#{path}"
|
309
328
|
puts ENV['PATH']
|
@@ -315,7 +334,7 @@ describe "Wortsammler conversion" do
|
|
315
334
|
end
|
316
335
|
|
317
336
|
it "compiles all documents" do
|
318
|
-
FileUtils.cd("testproject/30_Sources/ZSUPP_Tools") {|d|
|
337
|
+
FileUtils.cd("testproject/30_Sources/ZSUPP_Tools") { |d|
|
319
338
|
path=ENV['PATH']
|
320
339
|
ENV['PATH']="#{wortsammlerbin}:#{path}"
|
321
340
|
puts ENV['PATH']
|
@@ -330,30 +349,30 @@ end
|
|
330
349
|
|
331
350
|
describe "Wortsammler syntax extensions", :exp => false do
|
332
351
|
it "[RS_Comp_012] supports embedded images" do
|
333
|
-
tempdir
|
352
|
+
tempdir ="#{specdir}/../testoutput"
|
334
353
|
imagefile ="floating-image.pdf"
|
335
354
|
|
336
|
-
FileUtils.cd(tempdir){|c|
|
355
|
+
FileUtils.cd(tempdir) { |c|
|
337
356
|
FileUtils.cp("#{specdir}/#{imagefile}", ".")
|
338
357
|
|
339
358
|
mdfile="embedded-image.md"
|
340
359
|
|
341
360
|
mdtext=["#this is headline",
|
342
|
-
(5..100).to_a.map{|oi|
|
361
|
+
(5..100).to_a.map { |oi|
|
343
362
|
["\n\n",
|
344
363
|
"this is image\n\n~~EMBED \"#{imagefile}\" o 40mm 60mm~~",
|
345
|
-
(1..20).to_a.map{|ii|
|
364
|
+
(1..20).to_a.map { |ii|
|
346
365
|
"#{oi} und #{ii} lorem ipsum und blafasel"
|
347
366
|
}.join(" "),
|
348
367
|
"\n\n",
|
349
|
-
(5..15+oi).to_a.map{|ii|
|
368
|
+
(5..15+oi).to_a.map { |ii|
|
350
369
|
"#{oi} und #{ii} lorem ipsum und blafasel"
|
351
370
|
}.join(" "),
|
352
371
|
"\n\n"]
|
353
372
|
}
|
354
|
-
|
373
|
+
].flatten.join("\n")
|
355
374
|
|
356
|
-
File.open(mdfile, "w"){|f| f.puts mdtext}
|
375
|
+
File.open(mdfile, "w") { |f| f.puts mdtext }
|
357
376
|
|
358
377
|
system "#{wortsammler} -pi '#{mdfile}' -o '.' -f pdf:latex:html:docx"
|
359
378
|
FileUtils.rm imagefile
|
@@ -384,12 +403,12 @@ describe "Wortsammler syntax extensions", :exp => false do
|
|
384
403
|
end
|
385
404
|
|
386
405
|
it "TC_EXP_003 handles Markdown inlays", exp: false do
|
387
|
-
tempdir
|
406
|
+
tempdir ="#{specdir}/../testoutput"
|
388
407
|
mdinlayfile ="TC_EXP_003_1.md"
|
389
408
|
mdinlayfile_1 ="TC_EXP_003_2.md"
|
390
409
|
mdfile="tc_exp_003"
|
391
410
|
|
392
|
-
FileUtils.cd(tempdir){|c|
|
411
|
+
FileUtils.cd(tempdir) { |c|
|
393
412
|
FileUtils.cp("#{specdir}/#{mdinlayfile}", ".")
|
394
413
|
FileUtils.cp("#{specdir}/#{mdinlayfile_1}", ".")
|
395
414
|
|
@@ -397,38 +416,38 @@ describe "Wortsammler syntax extensions", :exp => false do
|
|
397
416
|
mdtext=["#this is headline",
|
398
417
|
"",
|
399
418
|
"~~~~",
|
400
|
-
"","now verbatim by indent inclucde #{mdinlayfile}", "",
|
419
|
+
"", "now verbatim by indent inclucde #{mdinlayfile}", "",
|
401
420
|
" ~~MD \"#{mdinlayfile}\"~~",
|
402
421
|
"~~~~",
|
403
422
|
"",
|
404
|
-
"","now full format inclucde #{mdinlayfile}", "",
|
423
|
+
"", "now full format inclucde #{mdinlayfile}", "",
|
405
424
|
"~~MD \"#{mdinlayfile}\"~~",
|
406
425
|
"",
|
407
|
-
"","now full format inclucde #{mdinlayfile_1}", "",
|
426
|
+
"", "now full format inclucde #{mdinlayfile_1}", "",
|
408
427
|
"~~MD \"#{mdinlayfile_1}\"~~",
|
409
|
-
|
428
|
+
].flatten.join("\n")
|
410
429
|
|
411
|
-
File.open("#{mdfile}.md", "w"){|f| f.puts mdtext}
|
430
|
+
File.open("#{mdfile}.md", "w") { |f| f.puts mdtext }
|
412
431
|
|
413
432
|
system "#{wortsammler} -pi '#{mdfile}.md' -o '.' -f txt"
|
414
433
|
FileUtils.rm mdinlayfile
|
415
434
|
FileUtils.rm mdinlayfile_1
|
416
435
|
}
|
417
436
|
|
418
|
-
ref
|
437
|
+
ref = File.open("#{specdir}/tc_exp_003_reference.txt").read
|
419
438
|
result = File.open("#{tempdir}/#{mdfile}.txt").read
|
420
439
|
ref.should==result
|
421
440
|
end
|
422
441
|
|
423
|
-
it "generates an index", exp: false do
|
424
|
-
system "wortsammler -pi \"#{specdir}/test_mkindex.md\" -f pdf:latex"
|
425
|
-
system "pdftotext \"#{
|
426
|
-
ref
|
427
|
-
result = File.open("#{
|
442
|
+
it "generates an index", exp: false do
|
443
|
+
system "wortsammler -pi \"#{specdir}/test_mkindex.md\" -f pdf:latex -o \"#{testoutput}\""
|
444
|
+
system "pdftotext \"#{testoutput}/test_mkindex.pdf\""
|
445
|
+
ref = File.open("#{specdir}/test_mkindex_reference.txt").read
|
446
|
+
result = File.open("#{testoutput}/test_mkindex.txt").read
|
428
447
|
ref.should==result
|
429
448
|
end
|
430
449
|
|
431
|
-
it "reports TeX messages", exp: false do
|
450
|
+
it "reports TeX messages", exp: false do
|
432
451
|
system "wortsammler -pi \"#{specdir}/test_mkindex.md\" -f pdf:latex >> \"#{specdir}/test_mkindex.lst\""
|
433
452
|
system "pdftotext \"#{specdir}/test_mkindex.pdf\""
|
434
453
|
result = File.open("#{specdir}/test_mkindex.lst").read
|