Skip to content

Commit

Permalink
Problema ao executar filtro pandoc_abnt no Windows #143
Browse files Browse the repository at this point in the history
  • Loading branch information
edusantana committed Apr 9, 2017
1 parent e58d4b9 commit cfe7a41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions lib/limarka/conversor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def pretextual(tempfile)
"epigrafe", "resumo", "abstract", "lista_ilustracoes", "lista_tabelas",
"lista_siglas", "lista_simbolos", "sumario"].each_with_index do |secao,indice|
template = "pretextual#{indice+1}-#{secao}"
Open3.popen3(ENV,"pandoc -f markdown \"--data-dir=#{options[:templates_dir]}\" --template=#{template} -t latex --filter #{pandoc_abnt_path}") {|stdin, stdout, stderr, wait_thr|
Open3.popen3("pandoc -f markdown \"--data-dir=#{options[:templates_dir]}\" --template=#{template} -t latex --filter #{pandoc_abnt_path}") {|stdin, stdout, stderr, wait_thr|
stdin.write(hash_to_yaml(t.configuracao))
stdin.write("\n")
if t.errata? and necessita_de_arquivo_de_texto.include?(secao) then
Expand Down Expand Up @@ -174,7 +174,7 @@ def secao_indice

def textual(pretextual_tempfile, postextual_tempfile)
valida_yaml
Open3.popen3(ENV,"pandoc -f markdown+raw_tex -t latex -s \"--data-dir=#{options[:templates_dir]}\" --template=trabalho-academico --normalize --top-level-division=chapter --include-before-body=#{pretextual_tempfile.path} --include-after-body=#{postextual_tempfile.path} --filter #{pandoc_abnt_path}") {|stdin, stdout, stderr, wait_thr|
Open3.popen3("pandoc -f markdown+raw_tex -t latex -s \"--data-dir=#{options[:templates_dir]}\" --template=trabalho-academico --normalize --top-level-division=chapter --include-before-body=#{pretextual_tempfile.path} --include-after-body=#{postextual_tempfile.path} --filter #{pandoc_abnt_path}") {|stdin, stdout, stderr, wait_thr|
stdin.write(File.read(options[:templates_dir] + '/templates/configuracao-tecnica.yaml'))
stdin.write("\n")
stdin.write(hash_to_yaml(t.configuracao))
Expand Down Expand Up @@ -240,7 +240,7 @@ def self.tex_file(configuracao)
def secao(template, condicao_para_conteudo, conteudo_externo)
s = StringIO.new

Open3.popen3(ENV,"pandoc -f markdown \"--data-dir=#{options[:templates_dir]}\" --template=#{template} --top-level-division=chapter -t latex --filter #{pandoc_abnt_path}") {|stdin, stdout, stderr, wait_thr|
Open3.popen3("pandoc -f markdown \"--data-dir=#{options[:templates_dir]}\" --template=#{template} --top-level-division=chapter -t latex --filter #{pandoc_abnt_path}") {|stdin, stdout, stderr, wait_thr|
stdin.write(hash_to_yaml(t.configuracao))
stdin.write("\n")
if (condicao_para_conteudo) then
Expand All @@ -250,13 +250,13 @@ def secao(template, condicao_para_conteudo, conteudo_externo)
stdin.close
s << stdout.read
exit_status = wait_thr.value # Process::Status object returned.
if(exit_status!=0) then puts ("Erro: " + stderr.read + "\nENV: " + ENV.to_s + "\npandoc_abnt_path: #{pandoc_abnt_path}").red end
if(exit_status!=0) then puts ("Erro: " + stderr.read).red end
}
s.string
end

def pandoc_abnt_path
ENV["PANDOC_ABNT_PATH"] or "pandoc_abnt"
ENV["PANDOC_ABNT_BAT"] or "pandoc_abnt"
end

end
Expand Down
2 changes: 1 addition & 1 deletion lib/limarka/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Limarka
VERSION = "0.7.2.pre7"
VERSION = "0.7.2"
end

0 comments on commit cfe7a41

Please sign in to comment.