Skip to content

Commit d46bd3c

Browse files
committed
chore: Combine Pandoc reader/writer bultins into custom
1 parent a9accd6 commit d46bd3c

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

docsrc/cli.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ Option Meaning
8787
* ``rockspec`` - globals allowed in rockspecs, by default added for files ending with ``.rockspec``;
8888
* ``luacheckrc`` - globals allowed in Luacheck configs, by default added for files ending with ``.luacheckrc``;
8989
* ``ldoc`` - globals allowed in LDoc config, by default added for files named ``config.ld``;
90-
* ``pandoc`` - globals allowed in Pandoc Lua filters;
90+
* ``pandoc`` - globals allowed in Pandoc Lua;
91+
* ``pandoc_filters`` - globals allowed in Pandoc Lua, subset specific to filters;
92+
* ``pandoc_custom`` - globals allowed in Pandoc Lua, subset specific to custom reader/writers;
9193
* ``sile`` - globals allowed in The SILE Typesetter and its package ecosystem;
9294
* ``none`` - no standard globals.
9395

src/luacheck/builtin_standards/init.lua

+1-2
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,7 @@ builtin_standards.sile = {
347347

348348
builtin_standards.pandoc = pandoc.pandoc
349349
builtin_standards.pandoc_filter = pandoc.filter
350-
builtin_standards.pandoc_reader = pandoc.reader
351-
builtin_standards.pandoc_writer = pandoc.writer
350+
builtin_standards.pandoc_custom = pandoc.custom
352351

353352
builtin_standards.none = {}
354353

src/luacheck/builtin_standards/pandoc.lua

+8-12
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,21 @@ local filter = {
3333
}
3434

3535
-- https://pandoc.org/custom-readers.html
36-
local reader = {
37-
globals = {
38-
"Reader", "Extensions", "ByteStringReader"
39-
},
40-
}
41-
4236
-- https://pandoc.org/custom-writers.html
43-
local writer = {
37+
local custom = {
4438
globals = {
45-
"PANDOC_DOCUMENT", "Writer", "Extensions", "Doc", "Template",
46-
"Blocksep", "ByteStringWriter", "CaptionedImage", "DisplayMath", "DoubleQuoted", "InlineMath", "SingleQuoted",
39+
-- custom scope
40+
"PANDOC_DOCUMENT",
41+
"ByteStringReader", "ByteStringWriter", "Doc", "Extensions", "Reader", "Template", "Writer",
42+
-- extra types applicable to readers/writers
43+
"Blocksep", "CaptionedImage", "DisplayMath", "DoubleQuoted", "InlineMath", "SingleQuoted",
4744
},
4845
}
4946

5047
local variants = {
51-
pandoc = { globals = combine(common, filter, reader, writer) },
48+
pandoc = { globals = combine(common, filter, custom) },
5249
filter = { globals = combine(common, filter) },
53-
reader = { globals = combine(common, reader) },
54-
writer = { globals = combine(common, writer) },
50+
custom = { globals = combine(common, custom) },
5551
}
5652

5753
return variants

0 commit comments

Comments
 (0)