Browse Source

Add parenscript Hello World.

* genenetwork.lisp (:genenetwork): Use :cl-who and :parenscript.
(cl-who:*attribute-quote-char*): Set to double quote character.
(home-ps): New hunchentoot handler.
main
Arun Isaac 4 months ago
parent
commit
4dde0d094f
Signed by: arunisaac GPG Key ID: 2E25EE8B61802BB3
  1. 16
      genenetwork.lisp

16
genenetwork.lisp

@ -1,5 +1,5 @@
(defpackage :genenetwork
(:use :common-lisp :hunchentoot)
(:use :common-lisp :cl-who :hunchentoot :parenscript)
(:import-from :legit :current-commit)
(:import-from :cl-json :encode-json-to-string)
(:export :main))
@ -18,6 +18,20 @@
(setf (hunchentoot:content-type*) "text/plain; charset=utf-8")
"Hello World!")
;; parenscript puts strings within single quotes. So, use double quote
;; for HTML attributes.
(setq cl-who:*attribute-quote-char* #\")
(hunchentoot:define-easy-handler (home-ps :uri "/ps") ()
(with-html-output-to-string (str)
(:html
(:head (:title "Parenscript hello world"))
(:body (:h2 "Parenscript hello world")
"Please click the link: "
(:a :href "#"
:onclick (ps (alert "Hello World!"))
"Hello World!")))))
(defvar *acceptor*
(make-instance 'hunchentoot:easy-acceptor :port 8080))

Loading…
Cancel
Save