limarka 0.8.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +7 -0
- data/lib/limarka/check.rb +5 -6
- data/lib/limarka/conversor.rb +19 -21
- data/lib/limarka/version.rb +1 -1
- data/limarka.gemspec +3 -4
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5a229c70a6161c259dd71818ccba1375ec410a84bbf851f2a852f70e2af0f1a
|
4
|
+
data.tar.gz: 14d0115165f5476b0a2b84ff1111cbe91f0aa5948f34d3259d8eb8cf2392c54e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5049c4f7525afc26ad260c8b37201b076486b98a2a9e848e80b19988b3ba3d4638b72c15262f310e6aa0361a44fb49068dd15f21b59fb4e095d0068c4feef386
|
7
|
+
data.tar.gz: e3502f1a3e0e609ba2b3bae739be9313e1523dd72d34243be5e26fdc5870ebca55f2ddac38384732f76eadf26fd61e45d2c93fc8c2eb5d91bf2344bbe05e29d1
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [v1.0.0](https://github.com/abntex/limarka/tree/v1.0.0) (2018-10-22)
|
4
|
+
[Full Changelog](https://github.com/abntex/limarka/compare/v0.8.0...v1.0.0)
|
5
|
+
|
6
|
+
**Melhorias implementadas:**
|
7
|
+
|
8
|
+
- Tornar o limarka compatível com o pandoc 2.0 [\#159](https://github.com/abntex/limarka/issues/159)
|
9
|
+
|
3
10
|
## [v0.8.0](https://github.com/abntex/limarka/tree/v0.8.0) (2018-10-20)
|
4
11
|
[Full Changelog](https://github.com/abntex/limarka/compare/v0.7.2...v0.8.0)
|
5
12
|
|
data/lib/limarka/check.rb
CHANGED
@@ -18,26 +18,25 @@ module Limarka
|
|
18
18
|
|
19
19
|
def check
|
20
20
|
if sistema
|
21
|
-
|
21
|
+
ler_pandoc_version
|
22
22
|
end
|
23
23
|
verifica_compatibilidade
|
24
24
|
puts "OK."
|
25
25
|
end
|
26
26
|
|
27
|
+
def ler_pandoc_version
|
28
|
+
self.pandoc = `pandoc --version`.split("\n")[0].split(" ")[1]
|
29
|
+
end
|
27
30
|
|
28
31
|
private
|
29
32
|
|
30
33
|
def verifica_compatibilidade
|
31
34
|
#byebug
|
32
35
|
if Gem::Version.new(pandoc) < Gem::Version.new(Check::PANDOC_VERSAO_MINIMA) || Gem::Version.new(pandoc) >= Gem::Version.new(Check::PANDOC_VERSAO_MAXIMA)
|
33
|
-
raise VersaoIncompativelError, "Versão incompatível do pandoc. Versão compatível: #{PANDOC_VERSAO_MINIMA} <= Versão < #{PANDOC_VERSAO_MAXIMA}"
|
36
|
+
raise VersaoIncompativelError, "Versão incompatível do pandoc. Versão compatível: #{Check::PANDOC_VERSAO_MINIMA} <= Versão < #{Check::PANDOC_VERSAO_MAXIMA}"
|
34
37
|
end
|
35
38
|
end
|
36
39
|
|
37
|
-
def ler_pandoc
|
38
|
-
self.pandoc = `pandoc --version`.split("\n")[0].split(" ")[1]
|
39
|
-
end
|
40
|
-
|
41
40
|
end
|
42
41
|
|
43
42
|
class VersaoIncompativelError < StandardError
|
data/lib/limarka/conversor.rb
CHANGED
@@ -23,7 +23,7 @@ module Limarka
|
|
23
23
|
attr_accessor :texto_tex
|
24
24
|
attr_accessor :txt
|
25
25
|
attr_accessor :usa_pdftotext
|
26
|
-
|
26
|
+
|
27
27
|
# @param trabalho [Trabalho]
|
28
28
|
def initialize(trabalho, options)
|
29
29
|
self.t = trabalho
|
@@ -45,7 +45,7 @@ module Limarka
|
|
45
45
|
pretextual(pretextual_tempfile)
|
46
46
|
postextual(postextual_tempfile)
|
47
47
|
textual(pretextual_tempfile,postextual_tempfile)
|
48
|
-
|
48
|
+
|
49
49
|
ensure
|
50
50
|
pretextual_tempfile.close
|
51
51
|
pretextual_tempfile.unlink
|
@@ -73,7 +73,7 @@ module Limarka
|
|
73
73
|
s << "---\n\n"
|
74
74
|
s.string
|
75
75
|
end
|
76
|
-
|
76
|
+
|
77
77
|
|
78
78
|
|
79
79
|
PRETEXTUAL = "templates/pretextual.tex"
|
@@ -83,8 +83,8 @@ module Limarka
|
|
83
83
|
def pretextual(tempfile)
|
84
84
|
s = StringIO.new
|
85
85
|
necessita_de_arquivo_de_texto = ["errata"]
|
86
|
-
["folha_de_rosto", "errata", "folha_de_aprovacao", "dedicatoria", "agradecimentos",
|
87
|
-
"epigrafe", "resumo", "abstract", "lista_ilustracoes", "lista_tabelas",
|
86
|
+
["folha_de_rosto", "errata", "folha_de_aprovacao", "dedicatoria", "agradecimentos",
|
87
|
+
"epigrafe", "resumo", "abstract", "lista_ilustracoes", "lista_tabelas",
|
88
88
|
"lista_siglas", "lista_simbolos", "sumario"].each_with_index do |secao,indice|
|
89
89
|
template = "pretextual#{indice+1}-#{secao}"
|
90
90
|
Open3.popen3("pandoc -f markdown \"--data-dir=#{options[:templates_dir]}\" --template=#{template} -t latex --filter #{pandoc_abnt_path}") {|stdin, stdout, stderr, wait_thr|
|
@@ -108,7 +108,7 @@ module Limarka
|
|
108
108
|
|
109
109
|
POSTEXTUAL = "templates/postextual.tex"
|
110
110
|
# Escreve no arquivo o conteúdo gerado referente ao pós-textual do documento.
|
111
|
-
# @param tempfile arquivo onde será escrito
|
111
|
+
# @param tempfile arquivo onde será escrito
|
112
112
|
def postextual(tempfile)
|
113
113
|
# Referências (obrigatório)
|
114
114
|
# Glossário (opcional)
|
@@ -125,13 +125,13 @@ module Limarka
|
|
125
125
|
s << secao_indice
|
126
126
|
|
127
127
|
cria_xxx_referencias
|
128
|
-
|
128
|
+
|
129
129
|
@postextual_tex = s.string
|
130
130
|
File.open(tempfile, 'w') { |file| file.write(postextual_tex) }
|
131
131
|
end
|
132
132
|
|
133
133
|
# Cria arquivo temporário de referencias.
|
134
|
-
#
|
134
|
+
#
|
135
135
|
# Separa o título em subtítulo quando contém `:`.
|
136
136
|
def cria_xxx_referencias
|
137
137
|
referencias_tempfile = Tempfile.new('referencias')
|
@@ -148,10 +148,10 @@ module Limarka
|
|
148
148
|
entry['subtitle'] = s[1].strip
|
149
149
|
end
|
150
150
|
end
|
151
|
-
|
151
|
+
|
152
152
|
b.save_to referencias_bib_file
|
153
153
|
end
|
154
|
-
|
154
|
+
|
155
155
|
def secao_referencias
|
156
156
|
secao("postextual1-referencias", false, t.referencias)
|
157
157
|
end
|
@@ -163,7 +163,7 @@ module Limarka
|
|
163
163
|
def secao_anexos
|
164
164
|
secao("postextual4-anexos", t.anexos?, t.anexos)
|
165
165
|
end
|
166
|
-
|
166
|
+
|
167
167
|
# @note Ainda não implementado
|
168
168
|
def secao_glossario
|
169
169
|
end
|
@@ -171,10 +171,10 @@ module Limarka
|
|
171
171
|
# @note Ainda não implementado
|
172
172
|
def secao_indice
|
173
173
|
end
|
174
|
-
|
174
|
+
|
175
175
|
def textual(pretextual_tempfile, postextual_tempfile)
|
176
176
|
valida_yaml
|
177
|
-
Open3.popen3("pandoc -f markdown+raw_tex -t latex -s \"--data-dir=#{options[:templates_dir]}\" --template=trabalho-academico --
|
177
|
+
Open3.popen3("pandoc -f markdown+raw_tex -t latex -s \"--data-dir=#{options[:templates_dir]}\" --template=trabalho-academico --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|
|
178
178
|
stdin.write(File.read(options[:templates_dir] + '/templates/configuracao-tecnica.yaml'))
|
179
179
|
stdin.write("\n")
|
180
180
|
stdin.write(hash_to_yaml(t.configuracao))
|
@@ -187,14 +187,14 @@ module Limarka
|
|
187
187
|
}
|
188
188
|
File.open(texto_tex_file, 'w') { |f| f.write(@texto_tex)}
|
189
189
|
end
|
190
|
-
|
190
|
+
|
191
191
|
def pretextual_tex_file
|
192
192
|
"#{options[:output_dir]}/xxx-pretextual.tex"
|
193
193
|
end
|
194
194
|
def postextual_tex_file
|
195
195
|
"#{options[:output_dir]}/xxx-postextual.tex"
|
196
196
|
end
|
197
|
-
|
197
|
+
|
198
198
|
def texto_tex_file
|
199
199
|
"#{options[:output_dir]}/#{Conversor.tex_file(t.configuracao)}"
|
200
200
|
end
|
@@ -205,7 +205,7 @@ module Limarka
|
|
205
205
|
def referencias_bib_file
|
206
206
|
"#{options[:output_dir]}/xxx-referencias.bib"
|
207
207
|
end
|
208
|
-
|
208
|
+
|
209
209
|
def valida_yaml
|
210
210
|
# não faz nada por enquanto
|
211
211
|
end
|
@@ -235,11 +235,11 @@ module Limarka
|
|
235
235
|
end
|
236
236
|
|
237
237
|
private
|
238
|
-
|
238
|
+
|
239
239
|
# Utilizado para gerar seções específicas do documento
|
240
240
|
def secao(template, condicao_para_conteudo, conteudo_externo)
|
241
241
|
s = StringIO.new
|
242
|
-
|
242
|
+
|
243
243
|
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|
|
244
244
|
stdin.write(hash_to_yaml(t.configuracao))
|
245
245
|
stdin.write("\n")
|
@@ -255,11 +255,9 @@ module Limarka
|
|
255
255
|
s.string
|
256
256
|
end
|
257
257
|
|
258
|
-
def pandoc_abnt_path
|
258
|
+
def pandoc_abnt_path
|
259
259
|
ENV["PANDOC_ABNT_BAT"] or "pandoc_abnt"
|
260
260
|
end
|
261
261
|
|
262
262
|
end
|
263
263
|
end
|
264
|
-
|
265
|
-
|
data/lib/limarka/version.rb
CHANGED
data/limarka.gemspec
CHANGED
@@ -19,14 +19,14 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
spec.requirements = 'pandoc, v1.19.1'
|
21
21
|
spec.post_install_message = 'O limarka depende de uma versão nova do pandoc (v1.19.1 ou superior) que ainda não está disponível nos repositórios de muitas distribuições. Será necessário instalar a nova versão manualmente: https://github.com/abntex/limarka/issues/138'
|
22
|
-
|
22
|
+
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.12"
|
25
25
|
spec.add_development_dependency "rake", "~> 11.0"
|
26
26
|
spec.add_development_dependency "rspec", "~> 3.5"
|
27
27
|
spec.add_development_dependency "pry-byebug"
|
28
28
|
spec.add_development_dependency "github_changelog_generator"
|
29
|
-
|
29
|
+
|
30
30
|
spec.add_dependency "clipboard"
|
31
31
|
spec.add_dependency "ffi"
|
32
32
|
spec.add_dependency "colorize"
|
@@ -35,8 +35,7 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.add_dependency "thor"
|
36
36
|
spec.add_dependency 'bibtex-ruby'
|
37
37
|
spec.add_dependency 'terminal-table'
|
38
|
-
spec.add_dependency 'pandoc_abnt'
|
38
|
+
spec.add_dependency 'pandoc_abnt', "~> 2.0.0"
|
39
39
|
spec.add_dependency 'guard'
|
40
40
|
spec.add_dependency 'guard-shell'
|
41
41
|
end
|
42
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: limarka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduardo de Santana Medeiros Alexandre
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -196,16 +196,16 @@ dependencies:
|
|
196
196
|
name: pandoc_abnt
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
|
-
- - "
|
199
|
+
- - "~>"
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version:
|
201
|
+
version: 2.0.0
|
202
202
|
type: :runtime
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
|
-
- - "
|
206
|
+
- - "~>"
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version:
|
208
|
+
version: 2.0.0
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: guard
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|