codemirror-lang-skrypt
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Skrypt extension for CodeMirror 6

Skrypt is a domain-specific text transformation language, designed to facilitate pattern-based transliteration and transcription. This package aims to provide the Skrypt language support for the CodeMirror editor. It includes:

  • Syntax highlighting (with a custom style)
  • Options autocompletion
  • Expression values hover tooltips
  • Basic linting:
    • Incorrect syntax
    • Undefined option and template usage
    • Unused options and templates
    • Invalid Unicode escapes

Installation

npm install codemirror-lang-skrypt

Usage

import { skrypt } from "codemirror-lang-skrypt"

new EditorView({
    extensions: [skrypt()],
});

This will enable all the features by default, but you can also import any of the extensions selectively to define a customized LanguageSupport yourself.

import { LanguageSupport } from "@codemirror/language"
import { SkryptLanguage, skryptHighlighting, skryptLint, skryptTooltip } from "codemirror-lang-skrypt"

new EditorView({
  extensions: [new LanguageSupport(SkryptLanguage, [skryptHighlighting, skryptLint, skryptTooltip])],
});

Development

Due to the lack of time and advanced knowledge of the CodeMirror libraries, this package does not include any automated tests, so it's necessary that you test it manually on an editor view instance. Whether you want to build the package for your personal needs, or you want to contribute (thank you!), you can do it by:

  1. Cloning the repository: git clone https://github.com/yaBobJonez/codemirror-lang-skrypt
  2. Installing the dependencies: npm install
  3. Preparing a dist using Rollup: npm run prepare

License

This project is licensed under the MIT License, simple and permissive. It is based on a template created by Marijn Haverbeke, also under the MIT License.

Package Sidebar

Install

npm i codemirror-lang-skrypt

Weekly Downloads

17

Version

1.1.0

License

MIT

Unpacked Size

41.1 kB

Total Files

12

Last publish

Collaborators

  • ya_bob_jonez