0.1.2 • Published 6 years ago

preact-prism v0.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

preact-prism npm version

use Prism syntax highlighter in preact projects.

Install

npm install preact-prism

or

yarn add preact-prism

Example

import { h, render } from 'preact';
import Code from 'preact-prism';
import 'prismjs/themes/prism-solarizedlight.css'; /* import prism themes */

const code = `
.container {
  position: relative;
  height: 100%;
}
.inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%)
}
`;

render(<Code code={code} language="css" />, document.body);
// or render(<Code language="css">{code}</Code>, document.body);
0.1.2

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago