Adds a languages option to force-load languages before the init callback. Minor restructuring has been done to get the plugin in functional format, in order to allow for the init callback to run after the loading of the languages.
Example usage in an .eleventy.js config file:
export default function(eleventyConfig){
eleventyConfig.addPlugin(SyntaxHighlight, {
languages: ['css-extras', 'ruby'],
init: function({Prism}){
// do stuff with Prism.languages.ruby…
}
})
};
PS: The diff looks rather large due to an indentation change; please toggle "hide whitespace" to see the actual changes.
Resolves https://github.com/11ty/eleventy-plugin-syntaxhighlight/issues/47.
Adds a
languages
option to force-load languages before theinit
callback. Minor restructuring has been done to get the plugin in functional format, in order to allow for theinit
callback to run after the loading of the languages.Example usage in an
.eleventy.js
config file:PS: The diff looks rather large due to an indentation change; please toggle "hide whitespace" to see the actual changes.