@liquify/highlight
v0.1.0
Published
Syntax highlighting for Liquid on the command line
Downloads
6,115
Readme
@liquify/highlight
Syntax highlighting for Liquid on the command line. Uses cli-highlight under the hood but does some extra post-processing when dealing with contained syntaxes. It applies Potion themed token colorization.
Why?
This module was created for usage by the Prettify CLI but has been appropriated in different packages and projects across the Liquify monorepo workspace.
Install
pnpm add @liquify/highlight ava -D
Usage
import highlight from '@liquify/highlight';
const string = `
{% if condition %}
<div class="xxx">
{{ object.prop | filter: 'something' }}
</div>
{% endif %}
`
// Returns a coloured string
highlight(string)
// Logs the coloured string
highlight.log(string)