Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/ignacemaes/ember-shiki

Embed code snippets with pretty syntax highlighting in Ember.js, powered by Shiki
https://github.com/ignacemaes/ember-shiki

ember ember-addon shiki syntax-highlighting

Last synced: 3 months ago
JSON representation

Embed code snippets with pretty syntax highlighting in Ember.js, powered by Shiki

Awesome Lists containing this project

README

        

[![Build Status][build-status-img]][build-status-link]
[![NPM][npm-badge-img]][npm-badge-link]
[![Ember Observer Score][ember-observer-badge]][ember-observer-url]
![Ember Version][ember-version]

# ๐ŸŒˆ ember-shiki

_Embed code snippets with pretty syntax highlighting in Ember.js, powered by Shiki_

[build-status-img]: https://github.com/IgnaceMaes/ember-shiki/workflows/CI/badge.svg
[build-status-link]: https://github.com/IgnaceMaes/ember-shiki
[npm-badge-img]: https://badge.fury.io/js/ember-shiki.svg
[npm-badge-link]: http://badge.fury.io/js/ember-shiki
[ember-observer-badge]: http://emberobserver.com/badges/ember-shiki.svg
[ember-observer-url]: http://emberobserver.com/addons/ember-shiki
[ember-version]: https://img.shields.io/badge/Ember-4.4+-brightgreen.svg

ember-shiki is an addon which makes using [Shiki](https://github.com/shikijs/shiki) in Ember a breeze. It offers a drop-in component to get syntax highlighting for code. This is perfect for documentation sites, blogs, or wherever you need pretty formatted code.

- โœ… TypeScript and Glint ready
- ๐Ÿงต V2 addon format
- ๐Ÿš€ FastBoot support
- ๐Ÿ“ฆ Lazy loaded packages โ€” minimal impact on initial load
- #๏ธโƒฃ Syntax highlighting for 170+ languages โ€” including `.gjs` and `.gts`
- ๐ŸŽจ Theme support: 29 included themes โ€” load any external
- ๐Ÿ”ข Line number support
- ๐Ÿ”ค Custom fonts โ€” including font ligature support
- ๐Ÿ“‹ Copy code to clipboard
- ๐Ÿท๏ธ Code block naming
- ๐Ÿ—‚๏ธ Group code blocks with tabs
- โœจ Line highlighting
- ๐Ÿ–Œ๏ธ Stylable via CSS variables

## Compatibility

- Embroider or ember-auto-import v2
- Ember.js v4.4 or above
- Node.js v16 or above

## Installation

```sh
npm install ember-shiki
# or
yarn add ember-shiki
# or
pnpm install ember-shiki
```

## Usage

Basic usage:

```js
import { CodeBlock } from 'ember-shiki';

```

See the deployed [docs app](https://ember-shiki.pages.dev/) for an interactive demo and information on all options.

## Contributing

See the [Contributing](CONTRIBUTING.md) guide for details.

## Acknowledgements

Heavily inspired by [VitePress](https://github.com/vuejs/vitepress).

## License

This project is licensed under the [MIT License](LICENSE.md).