https://github.com/nullvoxpopuli/prismjs-glimmer
glimmer syntax highlighting with prism.js
https://github.com/nullvoxpopuli/prismjs-glimmer
Last synced: over 1 year ago
JSON representation
glimmer syntax highlighting with prism.js
- Host: GitHub
- URL: https://github.com/nullvoxpopuli/prismjs-glimmer
- Owner: NullVoxPopuli
- License: mit
- Created: 2021-04-24T19:24:04.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-04-28T22:53:05.000Z (about 2 years ago)
- Last Synced: 2024-05-01T23:24:21.134Z (about 2 years ago)
- Language: JavaScript
- Homepage: https://prismjs-glimmer.nullvoxpopuli.com/
- Size: 435 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# prismjs-glimmer
[](https://www.npmjs.com/package/prismjs-glimmer)
[](https://lgtm.com/projects/g/NullVoxPopuli/prismjs-glimmer/)
glimmer syntax highlighting with [Prism.js](https://github.com/PrismJS/prism)
## Install
```bash
npm install prismjs-glimmer
```
## Usage
```js
import Prism from 'prismjs';
import { setup } from 'prismjs-glimmer';
setup(Prism);
Prism.highlightAll();
```
- the `javascript` language must be registered before `setup` is called.
- `setup` _must_ be called before any highlighting occurs.
Supported language tags:
```html
```
where `{tag}` could be:
- glimmer
- hbs
- html.hbs
- html.handlebars
- htmlbars
**NOTE** handlebars highlighting will use glimmer highlighting when this plugin is present
## CDN Usage
### Traditional Script Tags
```html
Prism.highlightAll();
```
## Node / cjs / `require`
```js
const Prism = require('prismjs');
const { setup } = require('prismjs-glimmer');
setup(Prism);
Prism.highlightAll();
```
Only Node 14 is supported
## Node ES Modules / `import`
```js
import Prism from 'prismjs';
import { setup } from 'prismjs-glimmer';
setup(Prism);
Prism.highlightAll();
```
With Node 14, launch with
```bash
NODE_OPTIONS="--experimental-vm-modules" node your-module-script.js
```
## Contributing
Debug with `pnpm debug -p 4201`
Visit `http://localhost:4201`
Run Tets with `yarn test` or `npm run test`