@codewars/codemirror-unicode-helper
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

codemirror-unicode-helper

CodeMirror extension for entering Unicode characters using LaTeX-like abbreviations.

Provides functions unicodeHelper and unicodeHelperWith.

  • unicodeHelper: Hint helper with preconfigured sequences.
  • unicodeHelperWith(pairs: [seq: string, sym: string][]): Returns a hint helper with privided pairs.

Usage

Using with preconfigured sequences:

import CodeMirror from "codemirror";
import "codemirror/addon/hint/show-hint";
import { unicodeHelper } from "@codewars/codemirror-unicode-helper";

CodeMirror.registerGlobalHelper(
  "hint",
  "unicode-helper",
  predicate,
  unicodeHelper
);

Using with custom sequences:

import CodeMirror from "codemirror";
import "codemirror/addon/hint/show-hint";
import { unicodeHelperWith } from "@codewars/codemirror-unicode-helper";

CodeMirror.registerGlobalHelper(
  "hint",
  "unicode-helper",
  predicate,
  unicodeHelperWith([
    ["div", "÷"],
    ["pi", "π"],
    ["sqrt", "√"],
    ["cbrt", "∛"],
  ])
);

Readme

Keywords

none

Package Sidebar

Install

npm i @codewars/codemirror-unicode-helper

Weekly Downloads

7

Version

0.1.0

License

MIT

Unpacked Size

28.6 kB

Total Files

29

Last publish

Collaborators

  • kazk