Closed JohnAD closed 4 years ago
Image of boxdrawing.nim
on a web page:
Also: I've not yet written a cursor-emulator for the PRE block.
Essentially, when generating JS, a timed event-handler will "blink" a solid block in the correct place whenever the cursor is turned on.
I'm also thinking the JS terminal should mimic a typical terminal by defaulting to a black background with white lettering.
I've got a little more refactoring to do, but the basics of color support are working. I've changed the box color in readmeexample.nim
to blue to make it visible against the black default background.
Having looked more closely at the code and re-thought more about it, I suspect I might start over with another PR. I think I can redo this with with a tighter coupling to the existing TerminalBuffer.
This is currently a work-in-progress. Please do not accept the PR yet.
This is an attempt to add javascript support to the
illwill
library.So, both
and
work. The second version creates a javascript file that can be pulled into a web page and started with something like:
Many basic functions are done. Some notes:
timerLoop(ms)
template. This is needed if an app is going to be useful in on both Windows/Linux and on a web page as JS. Since html is event-driven an infinite loop locks up the web page. The JS version of thetimerLoop
template creates an event handler and the non-JS versions sticks to thewhile true: .... sleep(20)
pattern seen on a computer.definitions.nim
contains types needed everywhere.js_support.nim
,posix_support.nim
, andwin_support.nim
will contain code specific to the target platform.