Skip to content

kamiazya/ink-highlight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

91 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

GitHub Action npm version License: MIT code style: prettier PRs Welcome

ink-highlight

Highlight component for Ink. Uses ink-highlight for the code syntax highlight on your cli application.

Installation

The plugin can then be installed using npm:

NPM

# yarn
yarn add ink-highlight
# or npm
npm install ink-highlight

Usage

import React from 'react';
import { render } from 'ink';
import { Highlight } from 'ink-highlight';

const code = `SELECT
  \`id\`,
  \`name\`
FROM \`users\`
WHERE
  \`id\` = 1;
`;

render(<Highlight code={code} language="sql" />);

result

API

Highlight Component

  • Props
type Props = {
  code: string;
  language?: string;
};

License

This software is released under the MIT License, see LICENSE.