GithubHelp home page GithubHelp logo

sebnozzi / miniscript-web-term Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 260 KB

Web-Terminal for MiniScript

License: Other

MAXScript 91.70% HTML 0.81% TypeScript 7.48%
command-line html javascript miniscript terminal typescript web xtermjs

miniscript-web-term's Introduction

MiniScript Web-Terminal

MiniScript terminal for the Web.

Screenshot of terminal styles

It allows you to write MiniScript programs that run on a web-terminal. Intrinsics like print and input interact directly with the terminal.

The terminal component is xterm.js. As such it supports all escape sequences that xterm.js is capable of.

The MiniScript implementation is extended to supports module import (either local modules or "lib" modules). Included are the same modules as "command-line" MiniScript.

Usage

Download one of the latest releases (the file miniscript-web-term.zip).

It consists of an "index.html" page and additional files / folders, among them the "lib" folder with "command-line" MiniScript modules.

Put your MiniScript files directly in the root folder or under a sub-folder of your choice.

Change "data-src-file" in "index.html" (on the "body" element) to point to the entry file of your program.

For example, if you put it in the root folder it would read:

<body data-src-file="myProgram.ms">

And if you put it in a sub-folder it would read:

<body data-src-file="src/myProgram.ms">

You can then serve the contents locally (e.g. with python3 -m http.server 8000) or zip them and upload somewhere (e.g. to itch.io).

Feel free to explore the example folder folder. You might want to remove it before publishing.

Publishing

In order to "publish" a project (e.g. to itch.io) you probably need to create a zip file containing the following:

  • index.html
  • the "dist/" folder
  • the "lib/" folder (to use built-in modules)
  • any other files / folders that your project uses (in particular your MiniScript source files)

Remember to adapt "index.html" accordingly.

Terminal Options

You can set / change the terminal options by declaring a (window) global terminalOptions variable according to the ITerminalOptions and ITerminalInitOnlyOptions interfaces.

For example:

window.terminalOptions = {
  theme: {
    background: "#191A19",
    foreground: "#F5F2E7",
  },
  fontSize: 16,
  cursorStyle: "block"
};

The included "index.html" already sets some options, so that you only need to adapt them as needed.

You can even remove the whole "script" section. In that case the default options will apply.

Building from source

To build from source make sure you have Node.js installed.

Then from the project's root folder:

npm install
npm run build

Once build you can serve the contents locally.

Serve locally

To serve locally, your could use Python's built-in web-server:

python3 -m http.server 8000

Alternatively you could consider either of these:

miniscript-web-term's People

Contributors

sebnozzi avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

joestrout

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.