ink-syntax-highlight
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

ink-syntax-highlight test

Synax highlight component for Ink.

Install

$ npm install ink-syntax-highlight

Usage

import React from 'react';
import {render, Text} from 'ink';
import SyntaxHighlight from 'ink-syntax-highlight';

render(<SyntaxHighlight code="const hello = 'world'" />);

Props

code

Type: string

Source code to highlight.

language

Type: string

Language of the source code. If you don't set it yourself, this component will try to auto-detect it. All languages of highlight.js are supported.

theme

Type: Theme

You can write your own theme and pass it as prop. More info regarding custom theme.

Package Sidebar

Install

npm i ink-syntax-highlight

Weekly Downloads

2,273

Version

1.0.1

License

MIT

Unpacked Size

4.58 kB

Total Files

7

Last publish

Collaborators

  • vitaliis