1.0.2 • Published 2 years ago

pre-highlighted v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

pre-highlighted

HTML5 custom element that extends <pre> element with syntax highlighting using ShikiJS

Installation

  1. Load Shiki into DOM
<script src="https://unpkg.com/shiki@latest/dist/index.unpkg.iife.js"></script>
  1. Load the custom element
<script src="https://unpkg.com/pre-highlighted@latest"></script>

Using npm

npm i pre-highlighted

Usage

<pre-highlighted lang="css" theme="github-dark">
  .red {
    background: red;
  }
</pre-highlighted>

Or alternatively:

<pre is="pre-highlighted" lang="css" theme="github-dark">
  .red {
    background: red;
  }
</pre>

Attributes

  • lang, programming language
  • theme, theme, consult Shiki docs for more
1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago