# @evergreen-wc/eve-highlight

> Highlight.js component made with lit element

Latest version **0.1.1** (published 2021-05-23) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @evergreen-wc/eve-highlight
pnpm add @evergreen-wc/eve-highlight
yarn add @evergreen-wc/eve-highlight
bun add @evergreen-wc/eve-highlight
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2021-05-23 |
| First published | 2018-12-27 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 26.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Grant Hutchinson |
| Maintainers | hutchgrant |

## Links

- npm: https://www.npmjs.com/package/@evergreen-wc/eve-highlight
- Repository: https://github.com/hutchgrant/evergreen-web-components
- Homepage: https://github.com/hutchgrant/evergreen-web-components#readme
- Issues: https://github.com/hutchgrant/evergreen-web-components/issues
- npm.io page: https://npm.io/package/@evergreen-wc/eve-highlight

## Dependencies (2)

- [lit](https://npm.io/package/lit.md) ^2.0.0-rc.2
- [highlight.js](https://npm.io/package/highlight.js.md) >=10.7.2

## Recent versions

- 0.1.1 (latest) — 2021-05-23
- 0.1.0 — 2021-05-22
- 0.0.10 — 2021-04-04
- 0.0.9 — 2019-07-02
- 0.0.7 — 2019-02-09
- 0.0.6 — 2019-01-15
- 0.0.5 — 2019-01-07
- 0.0.4 — 2018-12-31
- 0.0.3 — 2018-12-27
- 0.0.2 — 2018-12-27
- 0.0.1 — 2018-12-27

## README

# eve-highlight

An Evergreen Highlight.js Web Component

[Demo](https://hutchgrant.github.io/evergreen-web-components/docs/highlight)

### Install

```bash
npm i @evergreen-wc/eve-highlight
```

### Usage

```js
import { html, LitElement } from 'lit';
import '@evergreen-wc/eve-highlight';

// highlightjs themes https://github.com/highlightjs/highlight.js/tree/master/src/styles
import github from '@evergreen-wc/eve-highlight/themes/github.css';

// Javascript example
// Escape $ with \
const code = `
class MyComponent extends LitElement {
  constructor() {
    this.name = 'helloworld'
  }

  renderThing() {
    if(this.name === 'helloworld'){
      console.log(this.name)
    }
  }
}
customElements.define('my-component', MyComponent);
`;

class SomeComponent extends LitElement {
  render() {
    return html`
      <eve-highlight type="js" theme="${github}" code="${code}"></eve-highlight>
    `;
  }
}
customElements.define('some-component', SomeComponent);
```

### Props

| Property | Description |
| -------- | ----------- |
| type     | Set the syntax type e.g. html, css, js, xml, bash |
| theme    | Set the imported CSS file. |
| code     | Set the code string to highlight. |
| hljs     | Optionally you may wish to use a language not already registered due to optimization. You can import and register the languages in your own hljs object and add it as an attribute. |

---
_Source: https://npm.io/package/@evergreen-wc/eve-highlight · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
