diff --git a/FAQ b/FAQ index 8a15af9..54b73f7 100644 --- a/FAQ +++ b/FAQ @@ -15,8 +15,8 @@ Q) I want to take an HTML snapshot of a clog created page: (format t "=> ~A" (outer-html (document-element (html-document body)))) -or (save-body-to-file) +or see CLOG:SAVE-BODY-TO-FILE Q) I want to know where the :CLOG tutorials, demos and sources. -Use (clog-install-dir) +Use (clog:clog-install-dir) diff --git a/demos/01-demo.lisp b/demos/01-demo.lisp index 39e38c5..9010ab9 100644 --- a/demos/01-demo.lisp +++ b/demos/01-demo.lisp @@ -1,8 +1,8 @@ -(defpackage #:clog-user +(defpackage #:clog-demo-1 (:use #:cl #:clog) (:export start-demo)) -(in-package :clog-user) +(in-package :clog-demo-1) ;; Game Display (defconstant display-width 375) diff --git a/demos/02-demo.lisp b/demos/02-demo.lisp index 5b009b8..7c397b7 100644 --- a/demos/02-demo.lisp +++ b/demos/02-demo.lisp @@ -1,8 +1,8 @@ -(defpackage #:clog-user +(defpackage #:clog-demo-2 (:use #:cl #:clog) (:export start-demo)) -(in-package :clog-user) +(in-package :clog-demo-2) (defvar *global-list-box-hash* (make-hash-table :test 'equalp) "Username to update function") diff --git a/demos/03-demo.lisp b/demos/03-demo.lisp index 3ce00f4..0c91b39 100644 --- a/demos/03-demo.lisp +++ b/demos/03-demo.lisp @@ -1,11 +1,11 @@ ;;; As this demo uses eval do not run over the internet. ;;; This app gives access to its users your local files. -(defpackage #:clog-user +(defpackage #:clog-demo-3 (:use #:cl #:clog #:clog-gui) (:export start-demo)) -(in-package :clog-user) +(in-package :clog-demo-3) (defclass app-data () ((copy-buf diff --git a/demos/04-demo.lisp b/demos/04-demo.lisp index 5e732e5..a9e5f7e 100644 --- a/demos/04-demo.lisp +++ b/demos/04-demo.lisp @@ -1,10 +1,10 @@ ;;;; Demo 4 - CMS Website -(defpackage #:clog-user +(defpackage #:clog-demo-4 (:use #:cl #:clog #:clog-web) (:export start-demo)) -(in-package :clog-user) +(in-package :clog-demo-4) ;; Site Configuration (defparameter side-panel-size 200 "Size of menu") diff --git a/demos/README.md b/demos/README.md index 0047ff1..ad9743b 100644 --- a/demos/README.md +++ b/demos/README.md @@ -15,14 +15,7 @@ To load "clog": Load the demo: ``` -CL-USER> (load "/Users/dbotton/common-lisp/clog/demos/01-demo.lisp") -#P"/Users/dbotton/common-lisp/clog/demos/01-demo.lisp" -``` - -Start the demo: - -``` -CL-USER> (clog-user:start-demo) +CL-USER> (clog:run-demo 1) Hunchentoot server is started. Listening on 0.0.0.0:8080. HTTP listening on : 0.0.0.0:8080 diff --git a/source/clog-helpers.lisp b/source/clog-helpers.lisp index e2eff72..2c07495 100644 --- a/source/clog-helpers.lisp +++ b/source/clog-helpers.lisp @@ -47,7 +47,9 @@ (defun run-tutorial (num) "Run tutorial NUM" (load-tutorial num) - (funcall (symbol-function (find-symbol "START-TUTORIAL" "CLOG-USER")))) + (funcall (symbol-function (find-symbol + "START-TUTORIAL" + (format nil "CLOG-TUT-~A" num))))) ;;;;;;;;;;;;;;;;;;; ;; load-tutorial ;; @@ -67,7 +69,9 @@ (defun run-demo (num) "Run demo NUM" (load-demo num) - (funcall (symbol-function (find-symbol "START-DEMO" "CLOG-USER")))) + (funcall (symbol-function (find-symbol + "START-DEMO" + (format nil "CLOG-DEMO-~A" num))))) ;;;;;;;;;;;;;;; ;; load-demo ;; diff --git a/tutorial/01-tutorial.lisp b/tutorial/01-tutorial.lisp index 198fd14..4d5f5e6 100644 --- a/tutorial/01-tutorial.lisp +++ b/tutorial/01-tutorial.lisp @@ -1,8 +1,8 @@ -(defpackage #:clog-user ; Setup a package for our work to exist in +(defpackage #:clog-tut-1 ; Setup a package for our work to exist in (:use #:cl #:clog) ; Use the Common Lisp language and CLOG (:export start-tutorial)) ; Export as public the start-tutorial function -(in-package :clog-user) ; Tell the "reader" we are in the clog-user package +(in-package :clog-tut-1) ; Tell the "reader" we are in the clog-user package ;; Define our CLOG application diff --git a/tutorial/02-tutorial.lisp b/tutorial/02-tutorial.lisp index 4f0e772..6a1751b 100644 --- a/tutorial/02-tutorial.lisp +++ b/tutorial/02-tutorial.lisp @@ -1,8 +1,8 @@ -(defpackage #:clog-user +(defpackage #:clog-tut-2 (:use #:cl #:clog) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-2) (defun on-new-window (body) "On-new-window handler." diff --git a/tutorial/03-tutorial.lisp b/tutorial/03-tutorial.lisp index 6cd4557..019f823 100644 --- a/tutorial/03-tutorial.lisp +++ b/tutorial/03-tutorial.lisp @@ -1,8 +1,8 @@ -(defpackage #:clog-user +(defpackage #:clog-tut-3 (:use #:cl #:clog) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-3) (defun on-new-window (body) "On-new-window handler." diff --git a/tutorial/04-tutorial.lisp b/tutorial/04-tutorial.lisp index 25dd602..e0c6fb6 100644 --- a/tutorial/04-tutorial.lisp +++ b/tutorial/04-tutorial.lisp @@ -1,8 +1,8 @@ -(defpackage #:clog-user +(defpackage #:clog-tut-4 (:use #:cl #:clog) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-4) (defun my-on-click (obj) ; obj in any event is the target of the event (setf (color obj) (rgb 0 255 0))) ; this makes it possible to reuse event handlers diff --git a/tutorial/05-tutorial.lisp b/tutorial/05-tutorial.lisp index bb1f514..8b2836e 100644 --- a/tutorial/05-tutorial.lisp +++ b/tutorial/05-tutorial.lisp @@ -1,8 +1,8 @@ -(defpackage #:clog-user +(defpackage #:clog-tut-5 (:use #:cl #:clog) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-5) (defun my-on-click (obj) ;; Using connection-data-item it is possible to pass data that diff --git a/tutorial/06-tutorial.lisp b/tutorial/06-tutorial.lisp index 93b2cdf..9557992 100644 --- a/tutorial/06-tutorial.lisp +++ b/tutorial/06-tutorial.lisp @@ -1,8 +1,8 @@ -(defpackage #:clog-user +(defpackage #:clog-tut-6 (:use #:cl #:clog) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-6) (defun my-on-click (obj) (print "Event thread started") ; Every click will add a thread diff --git a/tutorial/07-tutorial.lisp b/tutorial/07-tutorial.lisp index cea042a..fdac403 100644 --- a/tutorial/07-tutorial.lisp +++ b/tutorial/07-tutorial.lisp @@ -1,8 +1,8 @@ -(defpackage #:clog-user +(defpackage #:clog-tut-7 (:use #:cl #:clog) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-7) (defun on-click (obj) (setf (text obj) "DEAD") diff --git a/tutorial/08-tutorial.lisp b/tutorial/08-tutorial.lisp index b3c56a6..d7e0c8d 100644 --- a/tutorial/08-tutorial.lisp +++ b/tutorial/08-tutorial.lisp @@ -1,8 +1,8 @@ -(defpackage #:clog-user +(defpackage #:clog-tut-8 (:use #:cl #:clog) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-8) (defclass app-data () ((drag-mutex diff --git a/tutorial/09-tutorial.lisp b/tutorial/09-tutorial.lisp index cce1db9..12b16eb 100644 --- a/tutorial/09-tutorial.lisp +++ b/tutorial/09-tutorial.lisp @@ -1,8 +1,8 @@ -(defpackage #:clog-user +(defpackage #:clog-tut-9 (:use #:cl #:clog) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-9) (defun on-new-window (body) (setf (title (html-document body)) "Tutorial 9") diff --git a/tutorial/10-tutorial.lisp b/tutorial/10-tutorial.lisp index 6b1a144..37109ce 100644 --- a/tutorial/10-tutorial.lisp +++ b/tutorial/10-tutorial.lisp @@ -1,8 +1,8 @@ -(defpackage #:clog-user +(defpackage #:clog-tut-10 (:use #:cl #:clog) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-10) ;;; A very brief example of using the canvas control. (defun on-new-window (body) diff --git a/tutorial/11-tutorial.lisp b/tutorial/11-tutorial.lisp index 7418a15..b88748b 100644 --- a/tutorial/11-tutorial.lisp +++ b/tutorial/11-tutorial.lisp @@ -29,11 +29,11 @@ ;;; We go in the browser to the file ;;; "http://127.0.0.1:8080/tutorial/tut-11.html" -(defpackage #:clog-user +(defpackage #:clog-tut-11 (:use #:cl #:clog) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-11) (defun on-new-window (body) ;; This will turn on debug output in the browser console. diff --git a/tutorial/12-tutorial.lisp b/tutorial/12-tutorial.lisp index d2eef93..c27d4b4 100644 --- a/tutorial/12-tutorial.lisp +++ b/tutorial/12-tutorial.lisp @@ -17,11 +17,11 @@ ;;; ;;; See START-TUTORIAL below. -(defpackage #:clog-user +(defpackage #:clog-tut-12 (:use #:cl #:clog) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-12) (defun on-main (body) (let ((sb (create-style-block body))) diff --git a/tutorial/13-tutorial.lisp b/tutorial/13-tutorial.lisp index 3cb5735..07d6226 100644 --- a/tutorial/13-tutorial.lisp +++ b/tutorial/13-tutorial.lisp @@ -1,8 +1,8 @@ -(defpackage #:clog-user +(defpackage #:clog-tut-13 (:use #:cl #:clog) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-13) (defun start-tutorial () "Start tutorial." diff --git a/tutorial/14-tutorial.lisp b/tutorial/14-tutorial.lisp index e78229f..d55b716 100644 --- a/tutorial/14-tutorial.lisp +++ b/tutorial/14-tutorial.lisp @@ -1,8 +1,8 @@ -(defpackage #:clog-user +(defpackage #:clog-tut-14 (:use #:cl #:clog) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-14) ;;; HTML 5 local storage are the best way to stort client side data ;;; and in general are a far better than cookies. diff --git a/tutorial/15-tutorial.lisp b/tutorial/15-tutorial.lisp index 1b6e372..d93404b 100644 --- a/tutorial/15-tutorial.lisp +++ b/tutorial/15-tutorial.lisp @@ -1,8 +1,8 @@ -(defpackage #:clog-user +(defpackage #:clog-tut-15 (:use #:cl #:clog) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-15) ;;; Brief demonstration of multimedia (defun on-new-window (body) diff --git a/tutorial/16-tutorial.lisp b/tutorial/16-tutorial.lisp index e8a2614..b6f3dd7 100644 --- a/tutorial/16-tutorial.lisp +++ b/tutorial/16-tutorial.lisp @@ -1,8 +1,8 @@ -(defpackage #:clog-user +(defpackage #:clog-tut-16 (:use #:cl #:clog) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-16) ;;; In previous tutorials we attached to an html file using bootstrap. For this tutorial we ;;; are going to create a bootstrap 4.0 page just using CLOG. diff --git a/tutorial/17-tutorial.lisp b/tutorial/17-tutorial.lisp index a2dfe5b..38bcf7f 100644 --- a/tutorial/17-tutorial.lisp +++ b/tutorial/17-tutorial.lisp @@ -1,8 +1,8 @@ -(defpackage #:clog-user +(defpackage #:clog-tut-17 (:use #:cl #:clog) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-17) ;;; In this tutorial we will use a CSS only alternative to bootstrap - ;;; https://www.w3schools.com/w3css/default.asp diff --git a/tutorial/18-tutorial.lisp b/tutorial/18-tutorial.lisp index 336dd03..ac8bf46 100644 --- a/tutorial/18-tutorial.lisp +++ b/tutorial/18-tutorial.lisp @@ -1,8 +1,8 @@ -(defpackage #:clog-user +(defpackage #:clog-tut-18 (:use #:cl #:clog) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-18) ;; Demonstrate drag and drop (defun on-new-window (body) diff --git a/tutorial/19-tutorial.lisp b/tutorial/19-tutorial.lisp index d1b7341..249e54c 100644 --- a/tutorial/19-tutorial.lisp +++ b/tutorial/19-tutorial.lisp @@ -1,8 +1,8 @@ -(defpackage #:clog-user +(defpackage #:clog-tut-19 (:use #:cl #:clog) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-19) ;;; In this tutorial we will see how to easily use a JavaScript ;;; component. In the static-files directory there is a simple diff --git a/tutorial/20-tutorial.lisp b/tutorial/20-tutorial.lisp index a6e9873..04bbd33 100644 --- a/tutorial/20-tutorial.lisp +++ b/tutorial/20-tutorial.lisp @@ -47,11 +47,11 @@ (js-execute obj (format nil "JSLists.applyToList('~A', 'ALL');" (html-id obj)))) -(defpackage #:clog-user +(defpackage #:clog-tut-20 (:use #:cl #:clog) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-20) (defun on-new-window (body) (clog-toggler:init-toggler body) diff --git a/tutorial/21-tutorial.lisp b/tutorial/21-tutorial.lisp index 4c52055..112e6f1 100644 --- a/tutorial/21-tutorial.lisp +++ b/tutorial/21-tutorial.lisp @@ -42,11 +42,11 @@ on the drop-root.")) (setf (hiddenp (drop-root new-obj)) t)))) new-obj)) -(defpackage #:clog-user +(defpackage #:clog-tut-21 (:use #:cl #:clog) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-21) (defun on-new-window (body) (let* ((drop-list (clog-drop-list:create-drop-list body :content "Top of tree")) diff --git a/tutorial/22-tutorial.lisp b/tutorial/22-tutorial.lisp index 34d8ce4..e01e69e 100644 --- a/tutorial/22-tutorial.lisp +++ b/tutorial/22-tutorial.lisp @@ -1,8 +1,8 @@ -(defpackage #:clog-user +(defpackage #:clog-tut-22 (:use #:cl #:clog #:clog-gui) ; For this tutorial we include clog-gui (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-22) ;;; Demostrate a virtual desktop using CLOG GUI (defun on-file-count (obj) diff --git a/tutorial/23-tutorial.lisp b/tutorial/23-tutorial.lisp index 5f49217..5d81b97 100644 --- a/tutorial/23-tutorial.lisp +++ b/tutorial/23-tutorial.lisp @@ -1,8 +1,8 @@ -(defpackage #:clog-user +(defpackage #:clog-tut-23 (:use #:cl #:clog #:clog-gui) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-23) ;; This is a simple demo using semaphores to wait for user input ;; ask demonstrates the mechanics in general and the modal dialog diff --git a/tutorial/24-tutorial.lisp b/tutorial/24-tutorial.lisp index 0ba1a2e..882ac9d 100644 --- a/tutorial/24-tutorial.lisp +++ b/tutorial/24-tutorial.lisp @@ -1,11 +1,11 @@ ;; In this tutorial we use clog-web to create a dynamic modern mobile ;; compatible web page using various clog-web containers. -(defpackage #:clog-user +(defpackage #:clog-tut-24 (:use #:cl #:clog #:clog-web) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-24) (defun on-new-window (body) (clog-web-initialize body) diff --git a/tutorial/25-tutorial.lisp b/tutorial/25-tutorial.lisp index 2b613ea..10147f3 100644 --- a/tutorial/25-tutorial.lisp +++ b/tutorial/25-tutorial.lisp @@ -16,11 +16,11 @@ ;;;; | | ;;;; --------------------------------------------------------- -(defpackage #:clog-user +(defpackage #:clog-tut-25 (:use #:cl #:clog #:clog-web) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-25) (defun on-new-window (body) (clog-web-initialize body) diff --git a/tutorial/26-tutorial.lisp b/tutorial/26-tutorial.lisp index e52cd73..1f91b7e 100644 --- a/tutorial/26-tutorial.lisp +++ b/tutorial/26-tutorial.lisp @@ -8,11 +8,11 @@ ;;;; completely flexible in how you choose to use it. -(defpackage #:clog-user +(defpackage #:clog-tut-26 (:use #:cl #:clog #:clog-web) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-26) (defun on-new-window (body) (clog-web-initialize body) diff --git a/tutorial/27-tutorial.lisp b/tutorial/27-tutorial.lisp index af6ff1a..de86369 100644 --- a/tutorial/27-tutorial.lisp +++ b/tutorial/27-tutorial.lisp @@ -1,8 +1,10 @@ -(defpackage #:clog-user +;; This tutorial demonstrates the panel box layout method + +(defpackage #:clog-tut-27 (:use #:cl #:clog) (:export start-tutorial)) -(in-package :clog-user) +(in-package :clog-tut-27) (defun on-new-window (body) (let* ((console (create-panel-box-layout body :left-width 200 :right-width 0)) diff --git a/tutorial/README.md b/tutorial/README.md index 02a560f..8cb75dd 100644 --- a/tutorial/README.md +++ b/tutorial/README.md @@ -10,17 +10,10 @@ To load "clog": (:CLOG) ``` -Load the tutorial: +Run the tutorial: ``` -CL-USER> (load "/Users/dbotton/common-lisp/clog/tutorial/01-tutorial.lisp") -#P"/Users/dbotton/common-lisp/clog/tutorial/01-tutorial.lisp" -``` - -Start the tutorial: - -``` -CL-USER> (clog-user:start-tutorial) +CL-USER> (clog:run-tutorial 1) Hunchentoot server is started. Listening on 0.0.0.0:8080. HTTP listening on : 0.0.0.0:8080