1.1.0 • Published 8 years ago

syntactor v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

Build Status

Syntactor

An editor with two basic goals: 1. Only allow valid code to be entered (no syntax errors) 2. Common code transformations in just as many or less keystrokes, compared to other editors

For now, it's only a JSON editor.

Usage

In your commandline:

yarn add syntactor
#or
npm install syntactor --save

In your code:

const Syntactor = require('syntactor');
Syntactor.render(document.querySelector('#container'), {
  initiallyShowKeymap: true,
  defaultValue: {answer: 42}
});

Or if you're using React (and ES2015):

import {Editor} from 'syntactor';

const SomeComponent = () => (
  <div>
    <Editor initiallyShowKeymap defaultValue={{answer: 42}}/>
  </div>
);

Props

These can be either passed as React props or as the 2nd argument into the Syntactor.render function.

NameTypeDefault Value
initiallyShowKeymapbooleantrue
defaultValueJSON{}

Contributing/Running the demo page

First clone this repo, then:

yarn

And start it with

yarn start
1.1.0

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago