IgnaceMaes / ember-shiki

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

Home Page:https://ember-shiki.pages.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status NPM Ember Observer Score Ember Version

🌈 ember-shiki

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

ember-shiki is an addon which makes using 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

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

Usage

Basic usage:

import { CodeBlock } from 'ember-shiki';

<template>
  <CodeBlock
    @code="console.log('hello world');"
    @language="js"
  />
</template>

See the deployed docs app for an interactive demo and information on all options.

Contributing

See the Contributing guide for details.

Acknowledgements

Heavily inspired by VitePress.

License

This project is licensed under the MIT License.

About

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

https://ember-shiki.pages.dev

License:MIT License


Languages

Language:TypeScript 39.9%Language:JavaScript 21.5%Language:Handlebars 20.7%Language:CSS 7.8%Language:HTML 5.1%Language:Prolog 5.0%