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 +4 -4
- data/.travis.yml +1 -2
- data/README.md +2 -0
- data/lib/pandoc_abnt/figura_filter.rb +8 -6
- data/lib/pandoc_abnt/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 972d5889d220fd4f87d60a5f8048bdf6d0ae3ba3
|
4
|
+
data.tar.gz: 4ae006e7a93a4ee196aae8b7574f5cbbc0eac894
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
@@ -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[
|
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
|
63
|
+
if not blocks
|
62
64
|
raise ArgumentError, "Problema no argumento passado: #{pandoc_json_tree}"
|
63
65
|
end
|
64
66
|
|
65
|
-
|
67
|
+
blocks.each do |node|
|
66
68
|
|
67
69
|
if (fonte?(node) and imagem?(anterior)) then
|
68
|
-
imagem_latex = convert_to_latex([
|
69
|
-
fonte_latex = convert_to_latex([
|
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(
|
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}"]}]]
|
data/lib/pandoc_abnt/version.rb
CHANGED