Skip to content

Latest commit

 

History

History
54 lines (35 loc) · 1.11 KB

README.md

File metadata and controls

54 lines (35 loc) · 1.11 KB

Line Number Plugin for Highlight.js

highlight.ln.js

Demo

Usage

Browser

<script src="highlight.min.js"></script>
<script src="highlight.ln.js/index.min.js"></script>
<script>
  hljs.highlightAll();
</script>

Node.js

import hljs from 'highlight.js/lib/core';
import css from 'highlight.js/lib/languages/css';

import LineNumberPlugin from '@taufik-nurrohman/highlight.ln.js';

hljs.addPlugin(LineNumberPlugin);

hljs.registerLanguage('css', css);

hljs.highlightAll();

CommonJS

const hljs = require('highlight.js/lib/core');
const css = require('highlight.js/lib/languages/css');

const LineNumberPlugin = require('@taufik-nurrohman/highlight.ln.js').default;

hljs.addPlugin(LineNumberPlugin);

hljs.registerLanguage('css', css);

hljs.highlightAll();

License

BSD