Skip to content

predetermined/tortellini

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tortellini 🥟

Tortellini is a minimal code editor written in TypeScript.

Features

  • Syntax highlighting
  • Code completion

Example Usage

import { Tortellini } from "tortellini";
                         // https://unpkg.com/tortellini/index.js

const editor = new Tortellini(
    document.querySelector("[data-editor]"),
    "javascript"
);

Options

// new Tortellini(element, language, options);
//                                   ^
const options = {
    //                  Default
    caretColor:         "#fff", // Provide a CSS color data type value
    indentionSize:      4
}

Supported Languages

  • JavaScript javascript
  • HTML html (Experimental)
  • CSS css

Instance functions

const editor = new Tortellini(/* ... */);

editor.code       // Get the written code
editor.remove();  // Reset the base element