@liquify/highlight
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

@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)

Readme

Keywords

none

Package Sidebar

Install

npm i @liquify/highlight

Weekly Downloads

373

Version

0.1.0

License

MIT

Unpacked Size

22.6 kB

Total Files

7

Last publish

Collaborators

  • sissel