• Stars
    star
    373
  • Rank 114,600 (Top 3 %)
  • Language
    JavaScript
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Build your own language using Tree Notation.
import header.scroll
permalink index.html
title JTree: Tree Notation SDK for TypeScript & Javascript
startColumns 4
import ciBadges.scroll

# Links
Tree Notation Homepage
 https://treenotation.org
Tree Notation Sandbox
 https://jtree.treenotation.org/sandbox
Tree Language Designer
 https://jtree.treenotation.org/designer
Release Notes
 https://jtree.treenotation.org/releaseNotes.html
Tree Notation FAQ
 https://faq.treenotation.org
TrueBase
 https://truebase.pub/
TypeScript Library
 https://github.com/treenotation/jtree
Tree Notation Subreddit
 https://reddit.com/r/treenotation
Ohayo - A data science studio powered by Tree Notation
 https://github.com/treenotation/ohayo
UnitTests
 https://jtree.treenotation.org/sandbox/test.html
PerfTests
 https://jtree.treenotation.org/sandbox/perfTests.html

? Who is this package built for?
Jtree is for people who want to design Tree Languages, make Tree editing tools, or use the Tree Component Web Framework.
You can think of jtree as similar to the Java Development Kit, except for Tree Notation instead of Java.

? How do I build a new language?
You can try the Grammar tutorial.
 link grammarTutorial.html Grammar tutorial

# Grammar Files
Jtree contains a Tree Language called "Grammar". You can write new Grammar files to define new languages. By creating a grammar file you get a parser, a type checker, syntax highlighting, autocomplete, a compiler, and virtual machine for executing your new language. Jtree also includes a simple web Tree Language Designer.
 https://jtree.treenotation.org/designer Designer

To make your language do really interesting things, you'll want to write some code to extend your language nodes in another language that you know. Jtree lets you create new languages using just Tree Notation, Tree Notation + TypeScript, or Tree Notation + Javascript. Tree Notation and Tree Languages can be built with any language, however, not just TypeScript and Javascript. We are looking for volunteers to build libraries/sdks in other host languages.

# Using Jtree

## Quick start
- Open https://gitpod.io/#https://github.com/breck7/jtree
- Run:
code
 npm install -g ts-node
 npm install .
 npm run test

Jtree currently includes over 10 compiled projects (aka "products") and more than a dozen Tree Languages.

# Basic TreeNode library for npm projects:
code
 const {TreeNode} = require("jtree/products/TreeNode.js")
 const tree = new TreeNode("hello world")
 console.log(tree.asString)

# Basic TreeNode library + Grammar Language for the browser:
code
 <script src="../../products/Utils.browser.js"></script>
 <script src="../../products/TreeNode.browser.js"></script>
 <script src="../../products/GrammarLanguage.browser.js"></script>

## jtree "sandbox" web app for exploring base Tree Notation
code
 npm install .
 npm run local
 open http://localhost:3333/

## jtree "Designer" web app for building new Tree Languages
code
 npm install .
 npm run local
 open http://localhost:3333/designer

## TreeComponentFramework for building web apps
This is a web framework still in the research stage. Whether it evolves into a serious line of effort is unknown.

## Sample Languages
More than 12 example Tree Languages for helping with various tasks. See the `langs/` folder.

##  Build Tools
If you look at the source, you will also see a set of build tools (such as Builder and TypeScriptRewriter). These are currently undocumented and not recommended for external use.

## Building all tools and running tests
code
 npm run build
 npm test

# Monorepo
Jtree is a monorepo. With on average over 1 major version released each month for the past 2.5 years, it would take a lot of overhead to constantly be updating 10+ different repositories and modules every month. Once we're more confident in the theory and best practices, it might make sense to break this repo into independent modules.
That being said, we despise unnecessary dependencies as much as anyone. If anyone wants to create some automated submodules built from the projects in this monorepo, to allow for consuming of a smaller subset of the code and dependencies in this module, feel free to do so.

## Visualization of the code base
 https://mango-dune-07a8b7110.1.azurestaticapps.net/?repo=breck7%2Fjtree Visualization
image images/diagram.svg

# Development Status
All breaking changes are mentioned in the releaseNotes. We follow semantic versioning, so breaking changes should not happen if you stay on the same major version.
 link releaseNotes.html releaseNotes

# Tree Notation Libraries in Other Languages
If you build a Tree Notation library/SDK in another language, let us know and we'll add a link.

If you are working on a Tree Notation library in a new host language, feel free to post an issue or ask for help in the  TreeNotation subreddit.
 https://reddit.com/r/treenotation subreddit

## How to bump versions
code
 npm run updateVersion NEW_NUMBER

# Alternatives Considered
This is the first Tree Notation library in existence, so there were no alternative implementations. Note and Space were predecessors to Tree Notation. If a better alternative low level notation to Tree Notation is possible, it has yet to be discovered.

All that said, the important part of this repo is not the code but the design patterns. Tree Notation is very simple, and you can implement the patterns contained here in your own code without using this library. In fact, that is often the best way to use Tree Notation!

## Editing in Sublime Text
It is helpful to set `"goto_anything_exclude_gitignore": true` to ignore files in gitignore. Read more here.
 https://breckyunits.com/code/my-sublime-setttings.html here

# ❤️ Public Domain ❤️

import footer.scroll

More Repositories

1

pldb

PLDB: a Programming Language Database. A computable encyclopedia about programming languages.
JavaScript
676
star
2

scroll

Scroll is a language for scientists of all ages. Scroll includes a command line app that builds static blogs, websites, CSVs, text files, and more.
JavaScript
441
star
3

ohayo

A free, fast, public domain data science studio
JavaScript
127
star
4

copypaster

Make web forms copy-pasteable.
JavaScript
100
star
5

30000hours

How many hours have you spent practicing programming?
59
star
6

domtree

See what your HTML looks like
JavaScript
47
star
7

breckyunits.com

Breck's Blog
HTML
44
star
8

space

This is no longer maintained. Try the much improved version called TreeNotation
JavaScript
31
star
9

CancerDB

CancerDB: a computable encyclopedia about cancer.
CSS
24
star
10

brecksblog

A high performance blog in under 250 lines of code. No MySQL needed!
PHP
22
star
11

ScrollHub

The fastest way to publish.
JavaScript
22
star
12

drillBits

Code from https://queue.acm.org/detail.cfm?id=3448307 unzipped
C
21
star
13

mac

Handy terminal commands for Mac OS X
Shell
19
star
14

research

I moved this folder. Keeping this repo up for archival purposes only.
17
star
15

sleepytimeconference

The conference that comes together while you sleep.
17
star
16

notation.scroll.pub

Scroll Notation Website
JavaScript
16
star
17

tryscroll

Try Scroll in your web browser
JavaScript
15
star
18

leafdb.org

A public domain database about trees.
15
star
19

pytree

Tree Notation Python Library
Python
14
star
20

music

Music Of a People. Music for the people by the people. #BuildPublicDomain
JavaScript
14
star
21

pau

Medical records you can copy and paste
JavaScript
12
star
22

wells

wells 1972 paper
9
star
23

truebase

TrueBase - information you can trust. Software for building computable encyclopedias.
TypeScript
9
star
24

note

This has been replaced by Space
JavaScript
8
star
25

swim

A test suite to make it easier to build Tree Notation libraries in new host langauges
8
star
26

thebook

Tree Notation the Book
7
star
27

copypastetaxes

An open source tax engine so all Americans can do their taxes using simple copy and paste
7
star
28

jefferson

Toy prototype of language for laws and government
6
star
29

simoji

Create back-of-the-envelope multi-agent simulations using emojis.
JavaScript
6
star
30

blog.treenotation.org

Blog of the Tree Notation Lab
Shell
5
star
31

NewtonDB

A database of physics equations and experiments
JavaScript
5
star
32

news.pub

BuilderNews. Builders helping builders. Watch builders try your creations.
HTML
5
star
33

faq.scroll.pub

Scroll Notation FAQ
5
star
34

talkToMoreUsers

"I don't know of a single case of a startup that felt they spent too much time talking to users." - JL #AccelerateTheCures
5
star
35

ovarianlottery.org

HTML
4
star
36

book

Source code for book: A New Way to Program. Particle Notation, Scroll, and the Parsers Programming Language Explained
4
star
37

speedcoach

Benchmark node.js modules to make them faster and lighter
JavaScript
4
star
38

crawlers

Crawlers for extracting measurements from the web for Scroll datasets
JavaScript
4
star
39

lightos

An implementation of Dynamic Land's RealTalk OS
4
star
40

publicdomaincompany.com

Our corporate homepage, blog, and legal department's hard drive.
CSS
4
star
41

pledge.pub

The Public Domain Pledge
4
star
42

codeduel.org

I wish I had heard of this site! - Alexander Hamilton
HTML
4
star
43

lime

A rudimentary implementation of the sublime syntax highlighting engine that I made from reading the docs.
JavaScript
4
star
44

wws

The World Wide Scroll
JavaScript
4
star
45

sets.scroll.pub

Demonstrations of ScrollSets
4
star
46

apply

Web form like its Web 4.0
3
star
47

liberateIdeas

Interesting docs for the Intellectual Freedom movement
3
star
48

longbeach.pub

The Long Beach Pub is a public domain newspaper serving the people of Long Beach, CA
3
star
49

manhattan.pub

The Manhattan Pub is a public domain newspaper serving the people of New York City
3
star
50

munger

A language for honest accounting.
3
star
51

backup

Quickly backup a directory to s3.
JavaScript
3
star
52

funnytombstones.com

My retirement business
HTML
3
star
53

keyboard

Interactive Visualization of the history of the keys on my Mac keyboard
JavaScript
3
star
54

twitterToScroll

Export a Twitter account into a Scroll
JavaScript
3
star
55

hawaii.pub

The Hawai'i Pub is a public domain newspaper serving the people of Hawai'i
3
star
56

stamp-lang

An alternative to zip files for sharing a small collection of folders and text files.
JavaScript
3
star
57

patch

Tiny DSL for isomorphic query strings with zero dependencies
HTML
3
star
58

lab.treenotation.org

Website for Tree Notation Lab. A distributed public domain research lab dedicated to basic research and supported by The Public Domain Publishing Company.
HTML
3
star
59

ctree

Tree Notation C++ implementation
C++
2
star
60

zombo

I reverse engineered Zombo.com so that I learn how to do anything.
CSS
2
star
61

chicago.pub

The Chicago Pub is a public domain newspaper serving the people of Chicago, Illinois
2
star
62

vancouver.pub

The Vancouver Pub is a public domain newspaper serving the people of Vancouver, BC
2
star
63

brecksbananastand.com

I mean it's one banana Michael, what could it cost, $10?
CSS
2
star
64

slots

A demo Tree Language for Scheduling Meetings
2
star
65

mitosispictures.com

Pictures and gifs of cells dividing.
HTML
2
star
66

treerules

JavaScript
2
star
67

sellnothing.com

Believe in your younger self
HTML
2
star
68

grapher

TypeScript
2
star
69

norcal.pub

The Norcal Pub is a public domain newspaper serving the people of the San Francisco Bay Area.
HTML
2
star
70

nevergraduate.org

2
star
71

breckforpresident.com

Breck Yunits for President 2024
2
star
72

braindb

BrainDB: a computable encyclopedia about the brain.
2
star
73

ohayodatasets.breckyunits.com

Public domain datasets for Ohayo
JavaScript
2
star
74

chcopy

Copies the file permissions from one file to another.
Shell
2
star
75

wifinder

Find cafes with fast wifi
HTML
2
star
76

seattle.pub

The Seattle Pub is a public domain newspaper serving the people of Seattle, WA
2
star
77

databall.pub

This. Is. DATABALL!
HTML
2
star
78

freebird

Twitter banned me because they didn't understand "Die Hard" was a movie recommendation. Freebird decentralizes Twitter.
2
star
79

ScrollTalk

Short videos about Scroll and the WWS
2
star
80

strawberry

1
star
81

cldb

The Computer Language Database
1
star
82

schemas.ohayo.computer

A database of schemas to popular datasets
1
star
83

shroomdb.com

A demo
1
star
84

fished

Demo: A text serialization format for Fish Shell's history file.
JavaScript
1
star
85

cancerdb

coming soon
1
star
86

slides

CSS
1
star
87

washington.pub

The Washington Pub is a public domain newspaper serving the people of Washington D.C.
1
star
88

fitbit-story

1
star
89

gotopoint

A Sublime Package for going to a specific character in a file
Python
1
star
90

tumorpictures.com

Pictures of tumors.
JavaScript
1
star
91

aientist

HTML
1
star
92

asif

RFC: Prototype of ASIF
JavaScript
1
star
93

publicdomainwifi.com

Free wifi. No passwords.
HTML
1
star
94

corona-dataset

JavaScript
1
star
95

breckyunits.net

My code journal
CSS
1
star
96

wws-gui

JavaScript
1
star
97

duscore

Data Usability Score: A holistic scoring rubric for datasets
JavaScript
1
star
98

bigfile

Quickly find the biggest files lurking deep in a directory.
JavaScript
1
star
99

6k

1
star
100

git4

Same semantics. Simpler syntax. Coming soon.
1
star