forked from limarka/pandoc_abnt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
86 lines (64 loc) · 4.8 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "cucumber/rake/task"
RSpec::Core::RakeTask.new(:spec)
Cucumber::Rake::Task.new do |t|
t.cucumber_opts = %w{--format progress}
end
task :default => [:spec, :cucumber]
desc "Publica as features no site"
task :relish do
sh "relish push pandoc-abnt"
end
task :release => [:relish]
desc "Cria/recria as fixtures"
task :fixtures do
#FIXME remover original
Dir.chdir("spec/fixtures/files/tabelas") do
system "pandoc -f markdown+raw_tex simple_tables-with-footnote.md -o simple_tables-with-footnote.pandoc.json"
system "pandoc -f markdown+raw_tex simple_tables-with-footnote.md -o simple_tables-with-footnote.pandoc.tex"
system "pandoc -f markdown+raw_tex simple_tables-with-footnote.abntex.tex -o simple_tables-with-footnote.abntex.json"
original = "pipe_tables-cronograma.md"
system "pandoc -f markdown+raw_tex --wrap=none #{original} -o #{original.ext('.pandoc.json')}"
system "pandoc -f markdown+raw_tex --wrap=none #{original} -o #{original.ext('.pandoc.tex')}"
# criar original.ext('.pandoc-tabela.tex') : Código latex da tabela que será formatada (remove a fonte de pandoc.tex)
# criar original.ext('.abntex.tex') : Código esperado para o arquivo final (inclui fonte como legenda)
system "pandoc -f markdown+raw_tex --wrap=none #{original.ext('.abntex.tex')} -o #{original.ext('.abntex.json')}"
end
Dir.chdir("spec/fixtures/files/listas") do
original = "lista-letras-termiando-com-ponto.md"
system "pandoc -f markdown+raw_tex --wrap=none #{original} -o #{original.ext('.pandoc.json')}"
system "pandoc -f markdown+raw_tex --wrap=none #{original.ext('.transformacao-esperada.md')} -o #{original.ext('.transformacao-esperada.json')}"
original = "lista-letras-termiando-com-ponto-e-virgula.md"
system "pandoc -f markdown+raw_tex --wrap=none #{original} -o #{original.ext('.pandoc.json')}"
system "pandoc -f markdown+raw_tex --wrap=none #{original.ext('.transformacao-esperada.md')} -o #{original.ext('.transformacao-esperada.json')}"
original = "lista-letras-termiando-com-ponto-e-virgula-mix.md"
system "pandoc -f markdown+raw_tex --wrap=none #{original} -o #{original.ext('.pandoc.json')}"
system "pandoc -f markdown+raw_tex --wrap=none #{original.ext('.transformacao-esperada.md')} -o #{original.ext('.transformacao-esperada.json')}"
original = "lista-numerica-termiando-com-ponto-e-virgula-mix.md"
system "pandoc -f markdown+raw_tex --wrap=none #{original} -o #{original.ext('.pandoc.json')}"
system "pandoc -f markdown+raw_tex --wrap=none #{original.ext('.transformacao-esperada.md')} -o #{original.ext('.transformacao-esperada.json')}"
original = "lista-letras-separada-por-ponto-mix.md"
system "pandoc -f markdown+raw_tex --wrap=none #{original} -o #{original.ext('.pandoc.json')}"
system "pandoc -f markdown+raw_tex --wrap=none #{original.ext('.transformacao-esperada.md')} -o #{original.ext('.transformacao-esperada.json')}"
original = "lista-nao-ordenada-mix.md"
system "pandoc -f markdown+raw_tex --wrap=none #{original} -o #{original.ext('.pandoc.json')}"
system "pandoc -f markdown+raw_tex --wrap=none #{original.ext('.transformacao-esperada.md')} -o #{original.ext('.transformacao-esperada.json')}"
original = "lista-nao-ordenada-terminando-com-letra-mix.md"
system "pandoc -f markdown+raw_tex --wrap=none #{original} -o #{original.ext('.pandoc.json')}"
system "pandoc -f markdown+raw_tex --wrap=none #{original.ext('.transformacao-esperada.md')} -o #{original.ext('.transformacao-esperada.json')}"
original = "lista-maiusculo.md"
system "pandoc -f markdown+raw_tex --wrap=none #{original} -o #{original.ext('.pandoc.json')}"
system "pandoc -f markdown+raw_tex --wrap=none #{original.ext('.transformacao-esperada.md')} -o #{original.ext('.transformacao-esperada.json')}"
original = "alineas-texto-sem-indentado.md"
system "pandoc -f markdown+raw_tex --wrap=none #{original} -o #{original.ext('.pandoc.json')}"
system "pandoc -f markdown+raw_tex --wrap=none #{original.ext('.transformacao-esperada.md')} -o #{original.ext('.transformacao-esperada.json')}"
end
Dir.chdir("spec/fixtures/files/quadros") do
original = "quadro-com-id-titulo-e-fonte.md"
system "pandoc -f markdown+raw_tex --wrap=none #{original} -o #{original.ext('.pandoc.json')}"
#system "pandoc -f markdown+raw_tex --wrap=none #{original.ext('.transformacao-esperada.md')} -o #{original.ext('.transformacao-esperada.json')}" # removido pq não funciona mais o parse com código fore do begin e and longtable.
system "pandoc -f markdown+raw_tex --wrap=none #{original.ext('.apenas-tabela.md')} -o #{original.ext('.apenas-tabela.json')}"
system "pandoc -f markdown+raw_tex --wrap=none #{original.ext('.apenas-tabela.md')} -o #{original.ext('.apenas-tabela.tex')}"
end
end