https://github.com/codewars/codemirror-unicode-helper
CodeMirror extension for entering Unicode characters with ASCII sequences. Defaults to LaTeX-like abbreviations.
https://github.com/codewars/codemirror-unicode-helper
codemirror
Last synced: 10 months ago
JSON representation
CodeMirror extension for entering Unicode characters with ASCII sequences. Defaults to LaTeX-like abbreviations.
- Host: GitHub
- URL: https://github.com/codewars/codemirror-unicode-helper
- Owner: codewars
- License: mit
- Created: 2020-11-26T11:26:37.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-03-14T02:22:58.000Z (almost 5 years ago)
- Last Synced: 2025-04-18T14:14:54.352Z (10 months ago)
- Topics: codemirror
- Language: TypeScript
- Homepage: https://codewars.github.io/codemirror-unicode-helper/
- Size: 11.7 KB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 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:
```javascript
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:
```javascript
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", "∛"],
])
);
```