This repository has been archived by the owner on Aug 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c338599
Showing
14 changed files
with
6,152 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
node_modules | ||
www/bundle.js | ||
www/bundle.js.gz | ||
www/bundle.js.map | ||
doc | ||
build | ||
.vscode | ||
*~ | ||
.idea | ||
www/glTF-Sample-Models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Prototype REPL interface for Calva. | ||
|
||
## Description | ||
|
||
This repo contains a prototype HTML5 REPL control, currently supporting syntax highlighting, selection, keyboard navigation and clipboard support. | ||
|
||
Ultimately it is intended to be a general presentation stream REPL interactor, in the vein of CLIM, Symbolics Open Genera and the earlier MIT CONS and CADR, with a modern twist. It is not directly tied to any language, so eventually it should be portable to any language you fancy, including ECMAScript. | ||
|
||
## Presentation What? | ||
|
||
You can think of a *presentation stream* as a stream much like stdout/stdin, but supporting rich user interface controls. Not only can you push text through it, you can push *any* data through it, and custom controls that react to that data are created inline to display and edit it. If you have ever used `Mathematica` or `Gorilla REPL`, you have an idea how this works. | ||
|
||
## Purpose | ||
|
||
Calva doesn't currently support a dedicated REPL display, but uses the builtin VSCode terminal. With exciting new features in Clojure 1.10, such as `datafy` and `nav`, it is now possible to build rich inspectors in Clojure | ||
in the vein of [CLIM](http://web.archive.org/web/20120707045546/http://www.mikemac.com:80/mikemac/clim/cover.html). | ||
|
||
Sadly, VSCode's editor does not support rich HTML embedded in a `vscode.TextDocument`, but the abilty to display interactive graphs, tables, etc. at the REPL is too tempting to pass by. Fortunately VSCode *does* support `WebView`, which allows us to have an embedded html view. | ||
|
||
Thus, this project was born. It is still rather an experiment- since we are an isolated web page within vscode, | ||
we literally need to re-build a syntax highlighting editor, undo/redo support etc from the ground up. | ||
|
||
Currently what we have is a simple console control, but by layering atop this, more shininess can be added. | ||
|
||
## Goals | ||
|
||
* A reusable (not tied to VSCode/Calva) html REPL. | ||
* High performance | ||
* Auto indent | ||
* Paredit | ||
* Completions | ||
* Customizable presentation types | ||
|
||
## Trying it out | ||
|
||
The build is fairly trivial, horay. | ||
|
||
clone this repository, and from within the directory: | ||
|
||
`$ npm i` | ||
|
||
`$ npm run dev` | ||
|
||
Now point your browser at `http://localhost:8080` and type away. The REPL is not yet connected, it is effectively a dumb terminal with syntax highlighting for now. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
*Smart update the selection- | ||
* do not change any lines that don't need to be. | ||
*mouse selection | ||
*Delete range on insert. | ||
*clipboard handler | ||
*insertString cursor positioning on paste is wrong | ||
undo <<< | ||
----------------------------------------- | ||
proper re-startable lexer again... | ||
|
||
match-parens | ||
|
||
auto-indent |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"ignore": ["**/*.test.ts", "**/*.spec.ts", ".git", "node_modules"], | ||
"watch": ["src/server"], | ||
"exec": "npm start", | ||
"ext": "ts" | ||
} |
Oops, something went wrong.