Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kherrick/x-postpress-code

A web component used for code highlighting.
https://github.com/kherrick/x-postpress-code

syntax-highlighting

Last synced: 10 days ago
JSON representation

A web component used for code highlighting.

Awesome Lists containing this project

README

        

# [x-postpress-code](https://kherrick.github.io/x-postpress-code/)

A web component used for code highlighting. [Try it out at JS BIN](https://j.mp/2JZUTAP).

## Usage

Use the type attribute and include the source in the default slot with `pre` tags to render static content:

```html


#/usr/bin/env bash
for file in *; do
echo $file
done

```

Lazy load the content to be highlighted by using both the type and src attributes:

```html

```

## Installation

### from unpkg:

```html

```

### from npm

```bash
npm i x-postpress-code
```

```js
import 'x-postpress-code'
```

## Uses the following [highlight.js languages](https://github.com/highlightjs/highlight.js/tree/master/src/languages)

* `bash`
* `c`
* `csharp`
* `cpp`
* `css`
* `javascript`
* `json`
* `markdown`
* `php`
* `plaintext`
* `python`
* `shell`
* `typescript`
* `xml`