UNPKG

kss

Version:

The Node.js port of KSS: A methodology for documenting CSS and building style guides

17 lines (14 loc) 371 B
'use strict'; const hljs = require('highlight.js'); module.exports = function(mainTwig) { mainTwig.extend((Twig) => { Twig.exports.extendFilter('hljs', (value, args) => { const lang = args && args[0] ? args[0] : 'html'; try { return hljs.highlight(lang, value, true).value; } catch (e) { console.log(e); } }); }); };