@code-blocks/eleventy-plugin

0.1.8 • Public • Published

@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 plugin
const codeblocks = require('@code-blocks/eleventy-plugin')

// some renderers
const math = require('@code-blocks/math')
const music = require('@code-blocks/music')

module.exports = function(eleventyConfig) {
  // pass the renderers to the plugin
  eleventyConfig.addPlugin(codeblocks([
    math,
    music,
  ]))
}

Available renderers:

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.

Package Sidebar

Install

npm i @code-blocks/eleventy-plugin

Weekly Downloads

7

Version

0.1.8

License

GPLv2

Unpacked Size

9.15 kB

Total Files

7

Last publish

Collaborators

  • idris-maps