pandoc2review 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/lib/pandoc2review.rb +1 -1
- data/lua/filters.lua +2 -2
- data/lua/review.lua +9 -18
- data/pandoc2review.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cfd0215db986170226f60ea72af5f323ca588196b0622cfaddd14fe16dbbd0e
|
4
|
+
data.tar.gz: b14fcc9ad8b5146dcbb13fe6e5f3bea7eb66d991596bef2f20fd6c649af4e1b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c441ec53f24068da40cbb31c83a0adce2a80c38c6dcb705227d4a147f019be367bd79b7d9afa7482ecd06d976e2503f5f4ca33cda6af85d63a14994875248fa
|
7
|
+
data.tar.gz: 68f1bfaece899793dc563c423387da38d73574122d90cb98fca45d807f0e35e855eb3d2d67f898965f38f337c6c59dbe219cf37ff41c2f52362e4989dc28e663
|
data/README.md
CHANGED
@@ -47,7 +47,7 @@ pandoc2review file > file.re
|
|
47
47
|
|
48
48
|
## Copyright
|
49
49
|
|
50
|
-
Copyright 2020-2023 Kenshi Muto
|
50
|
+
Copyright 2020-2023 Kenshi Muto and atusy
|
51
51
|
|
52
52
|
GNU General Public License Version 2
|
53
53
|
|
@@ -57,6 +57,10 @@ GNU General Public License Version 2
|
|
57
57
|
- [@takahashim](https://github.com/takahashim)
|
58
58
|
|
59
59
|
## Changelog
|
60
|
+
### 1.6.0
|
61
|
+
- Fix inline raw.
|
62
|
+
- Refactoring.
|
63
|
+
|
60
64
|
### 1.5.0
|
61
65
|
- Support Pandoc 3.
|
62
66
|
|
data/lib/pandoc2review.rb
CHANGED
@@ -55,7 +55,7 @@ class Pandoc2ReVIEW
|
|
55
55
|
@stripemptydev = nil
|
56
56
|
opts = OptionParser.new
|
57
57
|
opts.banner = 'Usage: pandoc2review [option] file [file ...]'
|
58
|
-
opts.version = '1.
|
58
|
+
opts.version = '1.6'
|
59
59
|
|
60
60
|
opts.on('--help', 'Prints this message and quit.') do
|
61
61
|
puts opts.help
|
data/lua/filters.lua
CHANGED
@@ -29,7 +29,7 @@ local function support_blankline(constructor)
|
|
29
29
|
local n_break = 0
|
30
30
|
local content = blocks[i].content
|
31
31
|
|
32
|
-
for
|
32
|
+
for _, elem in ipairs(x.content) do
|
33
33
|
if elem.tag == "LineBreak" then
|
34
34
|
-- Count the repeated number of LineBreak
|
35
35
|
n_break = n_break + 1
|
@@ -142,7 +142,7 @@ local function caption_div(div)
|
|
142
142
|
end
|
143
143
|
|
144
144
|
local function noindent(para)
|
145
|
-
first = para.content[1]
|
145
|
+
local first = para.content[1]
|
146
146
|
|
147
147
|
if (first and (first.tag == "RawInline") and
|
148
148
|
(first.format == "tex") and
|
data/lua/review.lua
CHANGED
@@ -161,13 +161,7 @@ function Para(s)
|
|
161
161
|
end
|
162
162
|
|
163
163
|
local function attr_val(attr, key)
|
164
|
-
|
165
|
-
for k, v in pairs(attr) do
|
166
|
-
if (k == key and v and v ~= "") then
|
167
|
-
return v
|
168
|
-
end
|
169
|
-
end
|
170
|
-
return ""
|
164
|
+
return attr[key] or ""
|
171
165
|
end
|
172
166
|
|
173
167
|
local function attr_classes(attr)
|
@@ -180,7 +174,7 @@ local function attr_classes(attr)
|
|
180
174
|
end
|
181
175
|
|
182
176
|
local function attr_scale(attr, key) -- a helper for CaptionedImage
|
183
|
-
scale = attr_val(attr, key)
|
177
|
+
local scale, count = attr_val(attr, key), 0
|
184
178
|
if (scale == "") or (key == "scale") then
|
185
179
|
return scale
|
186
180
|
end
|
@@ -195,10 +189,7 @@ local function attr_scale(attr, key) -- a helper for CaptionedImage
|
|
195
189
|
end
|
196
190
|
|
197
191
|
function Header(level, s, attr)
|
198
|
-
local headmark = ""
|
199
|
-
for i = 1, level do
|
200
|
-
headmark = headmark .. "="
|
201
|
-
end
|
192
|
+
local headmark = string.rep("=", level)
|
202
193
|
|
203
194
|
local classes = attr_classes(attr)
|
204
195
|
|
@@ -288,7 +279,7 @@ function CodeBlock(s, attr)
|
|
288
279
|
end
|
289
280
|
command = command or "list"
|
290
281
|
|
291
|
-
is_list = command == "list"
|
282
|
+
local is_list = command == "list"
|
292
283
|
|
293
284
|
|
294
285
|
local num = (is_list == false) and "" or (
|
@@ -411,7 +402,7 @@ function Table(caption, aligns, widths, headers, rows)
|
|
411
402
|
end
|
412
403
|
local tmp = {}
|
413
404
|
for i, h in pairs(headers) do
|
414
|
-
align = html_align(aligns[i])
|
405
|
+
local align = html_align(aligns[i])
|
415
406
|
if (config.use_table_align == "true") and (align ~= "") then
|
416
407
|
h = format_inline("dtp", "table align=" .. align) .. h
|
417
408
|
end
|
@@ -422,7 +413,7 @@ function Table(caption, aligns, widths, headers, rows)
|
|
422
413
|
for _, row in pairs(rows) do
|
423
414
|
tmp = {}
|
424
415
|
for i, c in pairs(row) do
|
425
|
-
align = html_align(aligns[i])
|
416
|
+
local align = html_align(aligns[i])
|
426
417
|
if (config.use_table_align == "true") and (align ~= "") then
|
427
418
|
c = format_inline("dtp", "table align=" .. align) .. c
|
428
419
|
end
|
@@ -523,7 +514,7 @@ function Div(s, attr)
|
|
523
514
|
local blankline = attr_val(attr, "blankline")
|
524
515
|
if blankline ~= "" then
|
525
516
|
local buffer = {}
|
526
|
-
for
|
517
|
+
for _ = 1, tonumber(blankline) do
|
527
518
|
table.insert(buffer, "//blankline")
|
528
519
|
end
|
529
520
|
return table.concat(buffer, "\n")
|
@@ -586,7 +577,7 @@ function RawInline(format, text)
|
|
586
577
|
if (format == "tex") then
|
587
578
|
return format_inline("embed", "|latex|" .. text)
|
588
579
|
else
|
589
|
-
return format_inline("embed", "|" .. format .. "|"
|
580
|
+
return format_inline("embed", "|" .. format .. "|" .. text)
|
590
581
|
end
|
591
582
|
end
|
592
583
|
|
@@ -618,7 +609,7 @@ local function configure()
|
|
618
609
|
|
619
610
|
if (metadata) then
|
620
611
|
-- Load config from YAML
|
621
|
-
for k,
|
612
|
+
for k, _ in pairs(config) do
|
622
613
|
if metadata[k] ~= nil then
|
623
614
|
config[k] = stringify(metadata[k])
|
624
615
|
end
|
data/pandoc2review.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pandoc2review
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenshi Muto
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unicode-eaw
|