mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-20 14:35:44 +00:00
Custom writers can define the extensions that they support via the
global `writer_extensions`. The variable's value must be a table with
all supported extensions as keys, and their default status as values.
E.g., the below specifies that the writer support the extensions `smart`
and `sourcepos`, but only the `smart` extension is enabled by default:
writer_extensions = {
smart = true,
sourcepos = false,
}
13 lines
333 B
Lua
13 lines
333 B
Lua
function Writer (doc, opts)
|
|
local output = 'smart extension is %s;\ncitations extension is %s\n'
|
|
local status = function (ext)
|
|
return opts.extensions:includes(ext) and 'enabled' or 'disabled'
|
|
end
|
|
return output:format(status('smart'), status('citations'))
|
|
end
|
|
|
|
writer_extensions = {
|
|
smart = true,
|
|
citations = false,
|
|
}
|