Wondering what’s next for npm?Check out our public roadmap! »

@code-blocks/eleventy-plugin

0.1.7 • 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.

Install

npm i @code-blocks/eleventy-plugin

DownloadsWeekly Downloads

11

Version

0.1.7

License

GPLv2

Unpacked Size

9.53 kB

Total Files

8

Last publish

Collaborators

  • avatar