Giter VIP home page Giter VIP logo

elm-text-editor's Introduction

elm-text-editor

A flexible text editor written in Elm

Check out the demo

Note:

  • This project is not published yet on package.elm-lang.org
  • I would not consider this project ready for use in production, since it's missing major features like scrolling and line wrap

Features / Architecture

This library implements an editor (duh) and a buffer. The buffer is separate from the editor to allow multiple editors to use the same buffer, such as in a multi-panel text editor.

Note: There's a checkmark next to implemented features

Buffer

  • file content
  • save status
  • syntax highlighting (cached)
  • decorations (eg underlines, tooltips, gutter icons)

The buffer implementation has helper functions for manipulating its content, like finding the end of a word.

Editor

  • cursor location
  • selection
  • rendering to the DOM
  • UI interaction (mouse and keyboard)
  • undo history
  • scroll position
  • auto-complete dialog
  • open decorations (in other words, decorations exist in the buffer but each editor tracks open decorations)
  • line wrap

I hope that one day this project will be comparable to Ace and CodeMirror, but Ace and CodeMirror have had quite a head start (about 7 years!).

Previous work and Inspiration

The editor behavior and keyboard shortcuts are based on Atom (because that's the editor I'm most familiar with).

Ace and CodeMirror are text editors designed to work in a web browser. They're both written in JavaScript, so integration with Elm is pretty meh.

Janiczek recently demonstrated a text editor in pure elm, which implements work-arounds for several issues I had faced in the past when creating a pure elm editor.

I hope this inspires somebody to try some stuff in Elm they’ve been needing but seemed too big / hard for them! You might, like me with this project, find out it’s in your reach - no doubt thanks to Elm
- Janiczek

elm-text-editor's People

Contributors

sidneynemzer avatar knewter avatar

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.