Skip to content

wcoder/typesetter.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

typesetter.js

Simple and extensible typesetter.

Demo

Install

npm i typesetter.js

Features

  • Realistic Key Processing Engine
  • Self-contained: Requires zero dependencies to work
  • Detecting typos

Options:

Name Type Description
data string text content for display
maxErrorsCount int limit errors (disable: 0)
cursorAutoShift bool skip whitespaces
skipComments bool skip comments for cursorAutoShift
skipEmptyLines bool skip empty lines for cursorAutoShift

Example

typesetter(element, {
    data: "function hashKey(obj) { return 1; }",
    maxErrorsCount: 5,
    cursorAutoShift: true,   // ignore whitespace
    skipComments: true,      // additional setup for cursorAutoShift
});

Developed just for fun. Inspired by the idea of https://typing.io/


© 2015 Yauheni Pakala | Apache License 2.0