halfmoon-highlight

1.0.5 • Public • Published

Halfmoon Highlight

The highlight.js theme found in the Halfmoon documentation.

Installation

Install the package with npm.

npm install halfmoon-highlight

Then, import it as a module.

import 'halfmoon-highlight';

The styles are also available from CDN.

<link href="https://cdn.jsdelivr.net/npm/halfmoon-highlight" rel="stylesheet" />

<!-- OR -->

<link href="https://unpkg.com/halfmoon-highlight" rel="stylesheet"/>

Usage

Install highlight.js and call the initialisation method.

hljs.initHighlightingOnLoad();

Then, include your code inside <pre> and <code> tags.

<pre>
	<code class="js">
		console.log('Hello world!');
	</code>
</pre>

If you need help, take a look at the highlight.js documentation.

Cards

Using the .is-card class on a <pre> tag will add the container styles from the Halfmoon documentation.

<pre class="is-card">
	<code class="js">
		console.log('Hello world!');
	</code>
</pre>

This should be used if the code block is part of a .card component.

License

MIT

Package Sidebar

Install

npm i halfmoon-highlight

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

6.09 kB

Total Files

4

Last publish

Collaborators

  • ja1den