GithubHelp home page GithubHelp logo

codewars / codemirror-agda Goto Github PK

View Code? Open in Web Editor NEW
6.0 5.0 3.0 62 KB

Agda mode and input helper for CodeMirror used on Codewars

Home Page: https://codewars.github.io/codemirror-agda/

License: MIT License

TypeScript 100.00%
codemirror agda

codemirror-agda's Introduction

codemirror-agda

CodeMirror extension for editing Agda.

Provides a function defineMode to define agda mode, and an array UNICODE_HELPER_PAIRS.

  • defineMode(CodeMirror): Define agda mode and MIME text/x-agda.
  • UNICODE_HELPER_PAIRS ([seq: string, sym: string][]): For entering Unicode characters with ASCII sequences using @codewars/codemirror-unicode-helper. A subset of agda-input-translations in agda-input.el.

See https://codewars.github.io/codemirror-agda/.

Usage

import CodeMirror from "codemirror";
import "codemirror/addon/mode/simple"; // `defineSimpleMode`
import "codemirror/addon/hint/show-hint"; // optional
import { unicodeHelperWith } from "@codewars/codemirror-unicode-helper"; // optional

import { defineMode, UNICODE_HELPER_PAIRS } from "@codewars/codemirror-agda";

defineMode(CodeMirror);
// Optionally register unicode input helper.
// `show-hint` addon is required.
CodeMirror.registerGlobalHelper(
  "hint",
  "agda-input",
  // only enable in agda mode
  (mode, cm) => mode && mode.name === "agda",
  unicodeHelperWith(UNICODE_HELPER_PAIRS)
);

Acknowledgments

Agda mode was contributed by @Bubbler-4.

codemirror-agda's People

Contributors

bubbler-4 avatar dependabot[bot] avatar kazk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

codemirror-agda's Issues

Add more superscript/subscript symbols

These symbols have certain uses in mathematics. All of them are in U+207x ~ U+208x range, and clearly visible in CodeWars editor font.

Proposed key mappings:

  ["^+", "⁺"], ["^-", "⁻"], ["^=", "⁼"], ["^(", "⁽"], ["^)", "⁾"],
  ["_+", "₊"], ["_-", "₋"], ["_=", "₌"], ["_(", "₍"], ["_)", "₎"],

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.