202308.9.1 • Published 9 months ago

tinycoder v202308.9.1

Weekly downloads
-
License
-
Repository
-
Last release
9 months ago

tinycoder

Browser code editor that aims to be kept as simple as possible.- Short description

Ups and downs

Ups:

  1. Simple to get around
  2. Has a Tkinter-styled config API

Downs:

  1. More event-based than property-based
  2. Doesn't handle automatic indentation

Examples

Changing the configuration

tc = new tinycoder(document.getElementById("tc"))
tc.config("syntaxHighlight", false)
console.log(tc.config("syntaxHighlight")) // Output: false

On special circumstances...

tc = new tinycoder(document.getElementById("tc"))
tc.events.update(function(e) {
	console.log("Code is now updated!", e)
})
tc.updateCode("let it = \"go\"") // Output: Code is now updated! {code: "let it = \"go\""}
// On user edit, the "update" event will not be fired.
// Use "edit" instead.

Documentation

For your ease, the documentation is given right here where are you watching this right now.

Events

NameSample objectFired on
update{"code": "let it = \"go\";"}Code updated programmatically via updateCode()
edit{"code": "let it = \"go\";", "code": false}Code edited programmatically via updateCode() and by user
focus{"code": "let it = \"go\";"}focus-like event
unfocus{"code": "let it = \"go\";"}blur-like event
anyAny from aboveAfter every event

Configuration keys

NameSample valueDescription
syntaxHighlighttrueEnables/disables syntax highlighting
lineNumberstrueEnables/disables line numbers
fontStr"normal 12px \"Cascadia Mono\""More information
202308.9.1

9 months ago

202308.9.0

9 months ago

202308.7.0

9 months ago

202308.6.2

9 months ago

202308.6.1

9 months ago

2023.8.0-6.1

9 months ago

2023.8.0-5.1

9 months ago