Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/kherrick/x-postpress-code
- Owner: kherrick
- Created: 2020-12-12T19:34:00.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-11-28T15:58:20.000Z (almost 2 years ago)
- Last Synced: 2024-10-08T14:06:57.702Z (about 1 month ago)
- Topics: syntax-highlighting
- Language: TypeScript
- Homepage: https://kherrick.github.io/x-postpress-code/
- Size: 85.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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`