/slate-prism

A Slate plugin to highlight code blocks using PrismJS

Primary LanguageJavaScriptApache License 2.0Apache-2.0

slate-prism

NPM version

A Slate plugin to highlight code blocks using PrismJS

Install

npm install slate-prism

Simple Usage

import Prism from 'slate-prism'

const plugins = [
  Prism()
]

Note: You have to add a Prism theme CSS to your application.

Arguments

  • [onlyIn: Function(Node)] — a filtering function to select code blocks.
  • [getSyntax: Function(Node)] — a function to determine syntax for a code block.