@code-blocks/eleventy-plugin
An eleventy plugin to parse code blocks
Usage
Install the plugin:
npm install @code-blocks/eleventy-plugin --save
Install the renderers you need, for example:
npm install @code-blocks/music --save
In the .eleventy.js
configuration file:
// the pluginconst codeblocks = // some renderersconst math = const music = module { // pass the renderers to the plugin eleventyConfig}
Available renderers:
- @code-blocks/charts
- @code-blocks/graphviz
- @code-blocks/math
- @code-blocks/music
- @code-blocks/tables
- @code-blocks/prism
There is already an official syntax highlighting plugin for eleventy. If you are just going to highlight code blocks, use that instead. However, if you are using other @code-blocks
renderers, it will break the official plugin. That is why there is a @code-blocks/prism
renderer.