Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

ParenBook/remote-dom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

remote-dom

Control a browser DOM from Common Lisp.

Overview

Usage

Example

First things first: Quickload

(ql:quickload :remote-dom)

First, create a document object:

(defvar doc (remote-dom:make-document))

Then, start the WebSockets server:

(remote-dom:start doc)

Now, run this code. This will create an HTML file (~/test.html) to act as the client to our DOM:

(with-open-file (stream (merge-pathnames #p"test.html" (user-homedir-pathname))
                        :direction :output
                        :if-exists :supersede
                        :if-does-not-exist :create)
  (write-string (remote-js:html (remote-dom::document-context doc)) stream))

Now, open ~/test.html. Then run this:

(let* ((remote-dom:*document* doc)
       (root (remote-dom:document-root doc))
       (text (remote-dom:make-text-node root "Hello, world!"))))

And you should see the string "Hello, world!" appear in an otherwise empty page.

License

Copyright (c) 2016 Fernando Borretti

Licensed under the MIT License.

About

A remote-controlled browser DOM

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published