forked from mpeterv/luacheck
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Move pandoc builtins to their own module and split filters, rea…
…ders, and writers
- Loading branch information
Showing
3 changed files
with
49 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
local common = { | ||
globals = { | ||
-- Global modules | ||
"pandoc", "lpeg", "re", | ||
} | ||
} | ||
|
||
-- https://pandoc.org/lua-filters.html#global-variables | ||
local filter = { | ||
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 | ||
-- - top level | ||
"Inlines", "Inline", "Blocks", "Block", "Meta", "Pandoc", | ||
-- - inline | ||
"Cite", "Code", "Emph", "Image", "LineBreak", "Link", "Math", "Note", "Quoted", "RawInline", "SmallCaps", | ||
"SoftBreak", "Space", "Span", "Str", "Strikeout", "Strong", "Subscript", "Superscript", "Underline", | ||
-- - block | ||
"BlockQuote", "BulletList", "CodeBlock", "DefinitionList", "Div", "Figure", "Header", "HorizontalRule", | ||
"LineBlock", "OrderedList", "Para", "Plain", "RawBlock", "Table", | ||
} | ||
} | ||
|
||
local reader = { | ||
globals = { | ||
"Reader", "Extensions", "ByteStringReader" | ||
} | ||
} | ||
|
||
local writer = { | ||
globals = { | ||
"PANDOC_DOCUMENT", "Writer", "Extensions", "Doc" | ||
} | ||
} | ||
|
||
return { | ||
common = common, | ||
filter = filter, | ||
reader = reader, | ||
writer = writer, | ||
} |