Teascade.net/public/terminal/README.md

72 lines
4.3 KiB
Markdown
Raw Normal View History

2018-04-20 08:16:01 +02:00
JavaScript Terminal
===================
JavaScript Terminal is a fun-project which allows people to create command line apps
(like they would regularly in Python on Java) but in JavaScript.
To get quickly started:
- [Okay, so _what_ is it?](#okay-so-what-is-it)
- [So how do I build it?](#so-how-do-i-build-it)
- [How do I use it?](#how-do-i-use-it)
- [What about the _nittygritty legal stuff_?](#what-about-the-nittygritty-legal-stuff)
Okay, so _what_ is it?
----------------------
The JavaScript Terminal is split into three major components
- `jsterminal.ts`
is the actual engine which displays the terminal and is able to draw text at certain style to a point on the terminal. It doesn't know any of the regular text-wrapping logic etc.
- `jash.ts`
is the bash of jsterminal.ts. Jash knows all of the text-wrapping logics, how 'history' should work and knows how to give print/println/readline to `Std.IO`
- `jsx.ts` is the final abstraction layer on top of all. This is probably neglected by many, but it's an "emulation" of the UNIX bash. It knows how to take commands and can traverse through directories even run commands and launch files. (Though all of this is happening in a virtualized file-system contained in RAM and possibly in cookies)
If you start working with this engine you should probably use TypeScript. It's a superset of JavaScript, but if you insist on working with JavaScript, that works out too, because TypeScript compiles to JavaScript!
So how do I build it?
---------------------
To run the engine you need [TypeScript][ts] to build the sources into browser-compatible JavaScript and [SASS][sass] to compile the sass into browser-compatible css. After that you're ready to go! I recommen building the JavaScript into ES6 because it's just superior to regular ES5 but _that's just my opinion_.
You also need [jQuery][jquery] (Tested with version 3.1.0+)
> "_But I don't like TypeScript/SCSS and I'm angry >:(_"
Well luckily you may have an alternative! I'll list here all the ports I know of, and you may use them if you wish, but I won't promise they'll be as good as this one!
- [Dart port][dart-terminal] by [Jeasonfire][jeasonfire] (WIP)
How do I use it?
----------------
I'm not sure :(
A lot of the usage you can find from the TypeScript docs included in the sources and `main.ts` and `testprogram.ts` or something.
What about the _nittygritty legal stuff_?
-----------------------------------------
Every part of the JavaScript Terminal is licensed under the [MIT-license][mit] (see [COPYING](COPYING)) excluding a few exceptions:
- `jsx.ts`, which is licensed under the [GNU GPLv3 License][gplv3] (see [COPYING-GPL](COPYING-GPL)).
- `main.ts`, `custom.scss`, `testprogram.ts`, `soundtest.ts` (all of these are testfiles) and the fabulous music for testing in `soundtest.ts`, [Grip of Nature by Sindwiller][gripnature] which are all licensed under [CC-0][cc0].
- JavaScript Terminal also (by default, because of GNU GPLv3 License) includes a copy of jquery v3.1.0 which is also licensed under the MIT license ([I think][jquery-license], this is **not legal advice**). It is suggested that you use a [CDN][jquery-cdn], especially if your terminal will be working over the internet.
This basically means that for the MIT-licensed parts, you can do [basically anything][mit-tldr], but you need to include the copyright and license with them.
For the GPLv3 licensed part (only `jsx.ts`) you can also do [Almost anything][gplv3-tldr], but you need to do few other steps too like keeping the same license with the project where it's used, state what changes have been done, discose source, and include build instructions.
**EITHER WAY** this isn't legal advice; I'm not a lawyer, I'm a gamedev.
[gripnature]: http://opengameart.org/content/grip-nature
[sass]: http://sass-lang.com/
[ts]: http://www.typescriptlang.org/
[jquery]: https://jquery.com/
[jquery-cdn]: https://code.jquery.com/
[dart-terminal]: https://github.com/Jeasonfire/dart-terminal/
[jeasonfire]: https://github.com/Jeasonfire/
[cc0]: https://creativecommons.org/licenses/by/4.0/
[mit]: https://en.wikipedia.org/wiki/MIT_License
[mit-tldr]: https://tldrlegal.com/license/mit-license
[gplv3]: https://www.gnu.org/licenses/gpl-3.0.html
[gplv3-tldr]: https://tldrlegal.com/license/gnu-general-public-license-v3-(gpl-3)
[jquery-license]: https://jquery.org/license/