Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hazelgrove/tylr
a tiny tile-based editor
https://github.com/hazelgrove/tylr
holes js-of-ocaml ocaml reasonml structure-editor
Last synced: 3 days ago
JSON representation
a tiny tile-based editor
- Host: GitHub
- URL: https://github.com/hazelgrove/tylr
- Owner: hazelgrove
- License: mit
- Created: 2020-08-10T03:07:39.000Z (over 4 years ago)
- Default Branch: melds
- Last Pushed: 2025-01-20T23:14:10.000Z (12 days ago)
- Last Synced: 2025-01-22T13:02:56.341Z (10 days ago)
- Topics: holes, js-of-ocaml, ocaml, reasonml, structure-editor
- Language: Reason
- Homepage: https://tylr.fun
- Size: 11.1 MB
- Stars: 292
- Watchers: 12
- Forks: 3
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `tylr` ![Build Status](https://github.com/hazelgrove/tylr/actions/workflows/deploy-branches.yml/badge.svg)
`tylr` is a tiny *tile-based editor*, a new kind of structure editor
that, like a text editor, supports linear token-level editing workflows
but, unlike a text editor, ensures your manipulated tokens can always
be parsed back into a well-formed abstract syntax tree (AST).Other structure editors restrict you to simple operations on the AST.
For example, if you have the expression `2 + 3 * 4` in
[Scratch](https://scratch.mit.edu/) or [MPS](https://www.jetbrains.com/mps/),
you can't select things like `* 4` or even `2 + 3`—never mind directly
manipulate them—because they don't correspond to complete subtrees in the AST.
Uniquely among structure editors, `tylr` lets you select and manipulate
near-arbitrary range selections, including those corresponding to sub- and
cross-tree portions of the AST.You can play with a running instance of this code at [tylr.fun](https://tylr.fun).
Click on the help button in the upper-right corner for a gif-laden
Twitter thread on how it works.## Building and running `tylr` locally
Install OPAM version ≥2.0 and use it to install OCaml 4.08.1 as described
[here](https://ocaml.org/docs/install.html).Clone this repo, run the following commands in the root directory,
and paste the output of the final command into your browser address bar.
```sh
make deps # build dependencies (locked in opam.export)
make # build tylr src
make echo-html # echo path to compiled page
```