0.2.3 • Published 7 years ago

highlight.js-polyfill v0.2.3

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

highlight.js polyfill · Build Status npm version

highlight.js - Syntax highlighting for the Web.

A polyfill for highlight.js to isolate various syntax themes because of global style pollution.
This package doesn't require modifying the source file.

How to use

Prepare

import 'highlight.js-polyfill/styles/index.css';

OR

import 'highlight.js-polyfill/styles/index.scss';

The latter need node-sass and sass-loader in Webpack.

Example

const theme = 'atom-one-dark';

return `
    <pre class=${theme}>
        <code class="hljs">
            ${hljs.highlight(lang, code, true).value}
        </code>
    </pre>
`;

It will render to :

<pre class="atom-one-dark">
    <code class="hljs">
        ...
    </code>
</pre>

About module

import hljsThemes from 'highlight.js-polyfill';

It will get an Array of syntax themes.

Build

$ npm run build 

Publish

$ npm run release
0.2.3

7 years ago

0.2.2

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago

0.1.0-c

7 years ago

0.1.0-b

7 years ago

0.1.0

7 years ago