Prism.js
You can use Prism.js by writing the following in marp.config.js
.
const Prism = require("prismjs");
const loadLanguages = require("prismjs/components/");
loadLanguages(["jsx", "php", "markdown"]);
module.exports = {
engine: ({ marp }) => {
marp.highlighter = (code, lang) =>
Prism.highlight(code, Prism.languages[lang], lang);
return marp;
},
};