Skip to content

Commit

Permalink
[NFY] chore: Call out read-only vs. writable globals in Pandoc builtins
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Aug 27, 2024
1 parent 1c44e4a commit a7dde7d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/luacheck/builtin_standards/pandoc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ local common = {
globals = {
-- Global modules
"pandoc", "lpeg", "re",
}
},
}

-- https://pandoc.org/lua-filters.html#global-variables
-- https://pandoc.org/lua-filters.html
local filter = {
globals = {
read_globals = {
-- Global variables passed to filters
"FORMAT", "PANDOC_READER_OPTIONS", "PANDOC_WRITER_OPTIONS", "PANDOC_VERSION", "PANDOC_API_VERSION",
"PANDOC_SCRIPT_FILE", "PANDOC_STATE",
-- Globals that can be used to create filter elements
},
globals = {
-- - top level
"Inlines", "Inline", "Blocks", "Block", "Meta", "Pandoc",
-- - inline
Expand All @@ -20,19 +22,21 @@ local filter = {
-- - block
"BlockQuote", "BulletList", "CodeBlock", "DefinitionList", "Div", "Figure", "Header", "HorizontalRule",
"LineBlock", "OrderedList", "Para", "Plain", "RawBlock", "Table",
}
},
}

-- https://pandoc.org/custom-readers.html
local reader = {
globals = {
"Reader", "Extensions", "ByteStringReader"
}
},
}

-- https://pandoc.org/custom-writers.html
local writer = {
globals = {
"PANDOC_DOCUMENT", "Writer", "Extensions", "Doc"
}
},
}

return {
Expand Down

0 comments on commit a7dde7d

Please sign in to comment.