Skip to content

Eleventy Syntax Highlighter v4.0.0

Choose a tag to compare

@zachleat zachleat released this 31 Jan 14:38

Adds new highlight JavaScript function, for use in 11ty.js templates.

Docs: https://www.11ty.dev/docs/plugins/syntaxhighlight/#javascript-function-(for-11ty.js)

e.g. sample.11ty.js:

module.exports = function(data) {
  let result = this.highlight("js", "var test;");
  return result;
};