pandoc_abnt 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d95916eadf2769d515bdee11bb9d4d5572b5ab1
4
- data.tar.gz: ce88446c18b34fce9266b853c80996018bf59134
3
+ metadata.gz: 972d5889d220fd4f87d60a5f8048bdf6d0ae3ba3
4
+ data.tar.gz: 4ae006e7a93a4ee196aae8b7574f5cbbc0eac894
5
5
  SHA512:
6
- metadata.gz: 24002a884091a032d40efb416d9244a89e3040b7706de72a7d8b91f643dd6b4442c425bb1eb59d0041153059a845e2fc193768d467eb19d394dc5f46a7f6bb1e
7
- data.tar.gz: 403310f86c4e87d0260813e71f1cdb39e6dfa01fb208f80e8c4f01f66a75d419dafd57bf5ed98e5e16555e288c3a1d77da715b6722d1f4f4edcd8614987af6c6
6
+ metadata.gz: 12010f61efa8c7424c364d00968d02392aa013becf017507393eda521fdf41d094933a824dc852b40e6702a2d27a990d520eadfdad777509d42fa2f6701d3fb5
7
+ data.tar.gz: 68cbd350ad63e1852dff61f9bc230cbdfb8dc1feac585f0a31da90045cbd45fcb796d942f4cf35aec0683033c7ac688a6a1823b00b0bc81f6e66b5ec22c2da2e
data/.travis.yml CHANGED
@@ -6,5 +6,4 @@ rvm:
6
6
  before_install:
7
7
  - gem install bundler -v 1.13.2
8
8
  - sudo apt-get update -qq
9
- - wget https://github.com/jgm/pandoc/releases/download/1.19.1/pandoc-1.19.1-1-amd64.deb && sudo dpkg -i pandoc-1.19.1-1-amd64.deb
10
-
9
+ - wget https://github.com/jgm/pandoc/releases/download/1.19.2.1/pandoc-1.19.2.1-1-amd64.deb && sudo dpkg -i pandoc-*.deb
data/README.md CHANGED
@@ -21,6 +21,8 @@ Or install it yourself as:
21
21
 
22
22
  $ gem install pandoc_abnt
23
23
 
24
+ Requer pandoc `v1.19.2.1`.
25
+
24
26
  ## Usage
25
27
 
26
28
  TODO: Write usage instructions here
@@ -53,20 +53,22 @@ LATEX
53
53
  # Exemplo de código:
54
54
  # [{"unMeta":{}},[{"t":"Para","c":[{"t":"Image","c":[["id",[],[["width","30%"]]],[{"t":"Str","c":"Título"}],["imagem.png","fig:"]]}]},{"t":"Para","c":[{"t":"Str","c":"Fonte:"},{"t":"Space","c":[]},{"t":"Str","c":"Autor."}]}]]
55
55
  tree = JSON.parse(pandoc_json_tree)
56
- meta = tree[0]
56
+ meta = tree["meta"]
57
+ blocks = tree["blocks"]
58
+ api = tree["pandoc-api-version"]
57
59
 
58
60
  filtrados = []
59
61
  anterior = nil
60
62
 
61
- if not tree[1]
63
+ if not blocks
62
64
  raise ArgumentError, "Problema no argumento passado: #{pandoc_json_tree}"
63
65
  end
64
66
 
65
- tree[1].each do |node|
67
+ blocks.each do |node|
66
68
 
67
69
  if (fonte?(node) and imagem?(anterior)) then
68
- imagem_latex = convert_to_latex([meta,[anterior]])
69
- fonte_latex = convert_to_latex([meta,[node]])
70
+ imagem_latex = convert_to_latex({"blocks"=>[anterior], "pandoc-api-version" => api, "meta" => meta})
71
+ fonte_latex = convert_to_latex({"blocks"=>[node], "pandoc-api-version" => api, "meta" => meta})
70
72
  texcode = reformata_figura_latex(imagem_latex, fonte_latex)
71
73
  raw_tex = {"t"=>"RawBlock","c"=>["latex",texcode]}
72
74
 
@@ -79,7 +81,7 @@ LATEX
79
81
  anterior = node
80
82
  end
81
83
 
82
- JSON.generate([meta,filtrados])
84
+ JSON.generate({"blocks"=>filtrados, "pandoc-api-version" => api, "meta" => meta})
83
85
 
84
86
 
85
87
  # result = <<-LATEX [{"unMeta":{}},[{"t":"RawBlock","c":["latex","\\begin{figure}[htbp]\n\\caption{Legenda da figura}\\label{id}\n\\begin{center}\n\\includegraphics[width=0.30000\\textwidth]{imagem.png}\n\\end{center}\n\\legend{Fonte: Autor.}\n\\end{figure}"]}]]
@@ -1,3 +1,3 @@
1
1
  module PandocAbnt
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pandoc_abnt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo de Santana Medeiros Alexandre