glimmer syntax highlighting with Prism.js
npm install prismjs-glimmerimport Prism from 'prismjs';
import { setup } from 'prismjs-glimmer';
setup(Prism);
Prism.highlightAll();- the
javascriptlanguage must be registered beforesetupis called. setupmust be called before any highlighting occurs.
Supported language tags:
<pre>
<code class="language-{tag}">where {tag} could be:
- glimmer
- hbs
- html.hbs
- html.handlebars
- htmlbars
NOTE handlebars highlighting will use glimmer highlighting when this plugin is present
<script type="text/javascript" src="/cdn/path/to/prismjs.min.js"></script>
<script type="text/javascript" src="/cdn/path/to/prismjs-glimmer/glimmer.js"></script>
<script type="text/javascript">Prism.highlightAll();</script>const Prism = require('prismjs');
const { setup } = require('prismjs-glimmer');
setup(Prism);
Prism.highlightAll();Only Node 14 is supported
import Prism from 'prismjs';
import { setup } from 'prismjs-glimmer';
setup(Prism);
Prism.highlightAll();With Node 14, launch with
NODE_OPTIONS="--experimental-vm-modules" node your-module-script.jsDebug with pnpm debug -p 4201
Visit http://localhost:4201
Run Tets with yarn test or npm run test