({
take: [
{ key: "code", type: "code", label: "Nunjucks" },
{ key: "data", type: "json", label: "Data" },
{ key: "escape", type: "toggle", label: "Escape characters" },
{ key: "trim", type: "toggle", label: "Trim blocks", value: true },
{
type: "import",
value: "https://mozilla.github.io/nunjucks/files/nunjucks.min.js",
},
],
make: ({ code, data, escape, trim }) => {
nunjucks.configure({ autoescape: escape, trimBlocks: trim })
return [
{
type: "code",
value: nunjucks.renderString(code, data),
},
]
},
})