Prism

Code syntax highlighting using Prism

Options See on deno.land

extensions string[]

The list of extensions this plugin applies to

Default:
[ ".html" ]
cssSelector string

The css selector to apply prism

Default:
"pre code"

Description

This plugin uses the Prism library to search and syntax highlight the code of any <pre><code> element.

Installation

Import this plugin in your _config.ts file to use it:

import lume from "lume/mod.ts";
import prism from "lume/plugins/prism.ts";

const site = lume();

site.use(prism(/* Options */));

export default site;

Configuration

Prism by default load the default languages markup, css, clike and javascript. You can load more languages in this way:

import lume from "lume/mod.ts";
import prism from "lume/plugins/prism.ts";

// Additional prism languages
import "npm:prismjs@1.29.0/components/prism-less.js";
import "npm:prismjs@1.29.0/components/prism-git.js";

const site = lume();
site.use(prism());

export default site;