JSPM

ink-syntax-highlight

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4441
  • Score
    100M100P100Q127690F
  • License MIT

Synax highlight component for Ink

Package Exports

  • ink-syntax-highlight

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ink-syntax-highlight) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.