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
Ao executar o pandoc_abnt filter no Windows é necessário invocar o filtro passando o caminho completo do arquivo BAT.

PANDOC_ABNT_BAT deve ser configurado para funcionar no Windows.
  • Loading branch information
edusantana committed Apr 8, 2017
1 parent bf628bc commit 6a9cf2e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/limarka/conversor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class Conversor
attr_accessor :txt
attr_accessor :usa_pdftotext

PANDOC_ABNT_PATH = ENV["PANDOC_ABNT_PATH"] or "pandoc_abnt"

# @param trabalho [Trabalho]
def initialize(trabalho, options)
self.t = trabalho
Expand Down Expand Up @@ -87,7 +89,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("pandoc -f markdown \"--data-dir=#{options[:templates_dir]}\" --template=#{template} -t latex --filter pandoc_abnt") {|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 +176,7 @@ def secao_indice

def textual(pretextual_tempfile, postextual_tempfile)
valida_yaml
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") {|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 +242,7 @@ def self.tex_file(configuracao)
def secao(template, condicao_para_conteudo, conteudo_externo)
s = StringIO.new

Open3.popen3("pandoc -f markdown \"--data-dir=#{options[:templates_dir]}\" --template=#{template} --top-level-division=chapter -t latex --filter pandoc_abnt") {|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 Down

0 comments on commit 6a9cf2e

Please sign in to comment.