### Load CLOG and Run Tutorial Source: https://github.com/rabbibotton/clog/blob/main/doc/clog-manual.html Load the CLOG package using Quicklisp and start the first tutorial. Ensure Quicklisp is configured and xdg-utils is installed on WSL for browser integration. ```common-lisp CL-USER> (ql:quickload :clog) CL-USER> (clog:run-tutorial 1) ``` -------------------------------- ### Create and Execute QLOT Setup Script Source: https://github.com/rabbibotton/clog/blob/main/QLOT.md This shell script automates the QLOT initialization, dependency loading, and CLOG builder launch. It's useful for creating a quick way to start your development environment. ```shell sbcl --eval "(ql:quickload :qlot)" \ --eval "(setf qlot:*project-root* (uiop:getcwd))" \ --eval "(qlot:init (uiop:getcwd))" \ --eval "(pushnew (uiop:getcwd) ql:*local-project-directories* :test #'equalp)" \ --eval "(ql:quickload :qtest/tools)" \ --eval "(clog-tools:clog-builder :project :qtest)" ``` -------------------------------- ### Install QuickLisp Source: https://github.com/rabbibotton/clog/blob/main/LINUX.md Downloads and installs the QuickLisp Common Lisp implementation. This script fetches QuickLisp, installs it to ~/.quicklisp, and adds it to the Lisp initialization file. ```bash curl -o /tmp/ql.lisp http://beta.quicklisp.org/quicklisp.lisp sbcl --no-sysinit --no-userinit --load /tmp/ql.lisp \ --eval '(quicklisp-quickstart:install :path "~/.quicklisp")' \ --eval '(ql:add-to-init-file)' \ --quit ``` -------------------------------- ### Install SBCL and Quicklisp Source: https://github.com/rabbibotton/clog/blob/main/ANDROID-TERMUX.md Downloads, installs, and configures SBCL from a custom build for Termux, followed by Quicklisp installation. ```bash curl -OL "https://github.com/bohonghuang/sbcl-termux-build/releases/download/2.3.3/sbcl-2.3.3-arm64-termux.tar.zst" unzstd -c "sbcl-2.3.3-arm64-termux.tar.zst" | tar -xf - cd "sbcl-2.3.3" sh install.sh ``` ```bash curl -o ql.lisp http://beta.quicklisp.org/quicklisp.lisp sbcl --no-sysinit --no-userinit --load ql.lisp \ --eval '(quicklisp-quickstart:install :path "~/.quicklisp")' \ --eval '(ql:add-to-init-file)' \ --quit sbcl --eval '(ql:quickload :quicklisp-slime-helper)' --quit ``` -------------------------------- ### Load OCICL Setup Script Source: https://github.com/rabbibotton/clog/blob/main/OCICL.md Run the OCICL setup script using SBCL to install OCICL. This script typically creates the necessary files and directories for OCICL to function. ```bash sbcl --load setup.lisp ``` -------------------------------- ### Load CLOG and Start REPL Source: https://github.com/rabbibotton/clog/blob/main/doc/clog-manual.html Load the CLOG library and start the interactive REPL. This is the initial setup for developing CLOG applications interactively. ```lisp (ql:quickload :clog) (clog:clog-repl) ``` -------------------------------- ### Install ECL and Quicklisp Source: https://github.com/rabbibotton/clog/blob/main/ANDROID-TERMUX.md Installs the ECL Common Lisp implementation and Quicklisp, then loads it within the ECL REPL. ```bash pkg install clang pkg install ecl curl -o ql.lisp http://beta.quicklisp.org/quicklisp.lisp ecl ``` ```lisp (load "ql.lisp") (quicklisp-quickstart:install :path "~/.quicklisp") (ql:add-to-init-file) (ql:quickload :quicklisp-slime-helper) ``` -------------------------------- ### Install QuickLisp Source: https://github.com/rabbibotton/clog/blob/main/WINDOWS.md Load the downloaded QuickLisp script with SBCL to install QuickLisp to a specified path and add it to your init file. Then, load the QuickLisp Slime helper. ```bash sbcl --no-sysinit --no-userinit --load /tmp/ql.lisp \ --eval '(quicklisp-quickstart:install :path "~/.quicklisp")' \ --eval '(ql:add-to-init-file)' \ --quit ``` ```bash sbcl --eval '(ql:quickload :quicklisp-slime-helper)' --quit ``` -------------------------------- ### Install UltraLisp Distro Source: https://github.com/rabbibotton/clog/blob/main/MACOS.md Install the UltraLisp distribution to access recent Common Lisp software through QuickLisp. ```bash sbcl --eval '(ql-dist:install-dist "http://dist.ultralisp.org/" :prompt nil)' --eval '(ql:update-all-dists)' --quit ``` -------------------------------- ### Initialize QLOT and Install Dependencies Source: https://github.com/rabbibotton/clog/blob/main/QLOT.md Use this REPL sequence to initialize QLOT for your project, set the project root, and install dependencies. Ensure you are in your project directory. ```lisp (ql:quickload :qlot) (setf qlot:*project-root* (uiop:getcwd)) (qlot:init (uiop:getcwd)) (qlot:install) ``` -------------------------------- ### CLOG-WEB-INITIALIZE Source: https://github.com/rabbibotton/clog/blob/main/doc/clog-manual.html Initializes clog-web and installs a clog-web object on connection. If `W3-CSS-URL` has not been loaded before, it is installed unless it is nil. ```APIDOC ## CLOG-WEB-INITIALIZE ### Description Initializes clog-web and installs a clog-web object on connection. If `W3-CSS-URL` has not been loaded before is installed unless is nil. ### Function Signature `CLOG-WEB-INITIALIZE CLOG-BODY &KEY (W3-CSS-URL "/css/w3.css")` ### Parameters * **CLOG-BODY**: The CLOG body object. * **&KEY W3-CSS-URL**: The URL for W3 CSS. Defaults to "/css/w3.css". ``` -------------------------------- ### Quickload Common Lisp Libraries Source: https://github.com/rabbibotton/clog/blob/main/VSCODE.md Load essential Common Lisp libraries using Quicklisp. Ensure these are installed before proceeding with VSCode setup. ```lisp (ql:quickload :cl-json) (ql:quickload :bordeaux-threads) (ql:quickload :usocket) (ql:quickload :flexi-streams) ``` -------------------------------- ### Install UltraLisp Distro Source: https://github.com/rabbibotton/clog/blob/main/LINUX.md Installs the UltraLisp distribution for QuickLisp, providing access to recent Common Lisp software. It also updates all existing distributions. ```bash sbcl --eval '(ql-dist:install-dist "http://dist.ultralisp.org/" :prompt nil)' --eval '(ql:update-all-dists)' ``` -------------------------------- ### Install Slime for Emacs Source: https://github.com/rabbibotton/clog/blob/main/MACOS.md Install the Slime (Superior Lisp Interaction Mode) extension for Emacs using QuickLisp. ```bash sbcl --eval '(ql:quickload :quicklisp-slime-helper)' --quit ``` -------------------------------- ### Get CLOG Installation Directory Source: https://github.com/rabbibotton/clog/blob/main/README.md Retrieve the installation directory for CLOG files, including source, tutorials, and demos, from the Common Lisp REPL. ```lisp (clog:clog-install-dir) ``` -------------------------------- ### Start CLOG Application Source: https://github.com/rabbibotton/clog/blob/main/tutorial/13-tutorial/README.md Execute this command after loading the CLOG application to start the web server and make the application accessible. ```lisp (hello-clog:start-app) ``` -------------------------------- ### Start CLOG Application Source: https://github.com/rabbibotton/clog/blob/main/tutorial/28-tutorial/README.md Execute this command after loading the hello-builder system to start the CLOG application. The application's output can be viewed in CLOG Builder. ```lisp (hello-builder:start-app) ``` -------------------------------- ### Load CLOG Tools and Start Builder in SBCL Source: https://github.com/rabbibotton/clog/blob/main/OCICL.md These Lisp expressions load the CLOG tools system and then start the CLOG builder. This is typically run after starting SBCL with the userinit file. ```lisp (asdf:load-system :clog/tools) (clog-tools:clog-builder) ``` -------------------------------- ### Initialize and Install CLOG with OCICL Source: https://github.com/rabbibotton/clog/blob/main/OCICL.md Use these commands to set up a new project directory and install the CLOG system using OCICL. Ensure your project directory is not named 'clog' to avoid circular dependencies. ```bash ocicl setup > init ocicl install clog ``` -------------------------------- ### Install CLOG and CLOG Builder Source: https://github.com/rabbibotton/clog/blob/main/ANDROID-TERMUX.md Installs the CLOG framework and its builder tool for creating GUI applications. ```bash sbcl --eval '(ql:quickload :clog/tools)' --quit ``` -------------------------------- ### Enable and Start CLOG systemd Service Source: https://github.com/rabbibotton/clog/blob/main/WEBSERVER.md Commands to enable the CLOG service to start on boot and to start it manually. ```bash sudo systemctl enable clogpower.service ``` ```bash sudo systemctl start clogpower.service ``` -------------------------------- ### Install SBCL and OCICL on Mac Source: https://github.com/rabbibotton/clog/blob/main/OCICL.md Install SBCL and OCICL on macOS using Homebrew. This command handles the installation of both essential components for development. ```bash brew install sbcl brew install ocicl ``` -------------------------------- ### Install Termux Packages Source: https://github.com/rabbibotton/clog/blob/main/ANDROID-TERMUX.md Installs essential packages for Termux, including SSH, Emacs, and Zstd. ```bash pkg upgrade pkg install openssh pkg install emacs pkg install zstd pkg install libsqlite ``` -------------------------------- ### Apache Module Installation for CLOG Source: https://github.com/rabbibotton/clog/blob/main/WEBSERVER.md Install necessary Apache modules for proxying HTTP and WebSocket traffic. ```bash a2enmod proxy a2enmod proxy_http a2enmod proxy_wstunnel ``` -------------------------------- ### Run a CLOG Demo Source: https://github.com/rabbibotton/clog/blob/main/demos/README.md Execute this command to start a CLOG demo. The demo number corresponds to the specific demo you wish to run. A web server will start, and a browser may open automatically. ```lisp 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 HTML Root : static-files/ Boot file default : /boot.html ``` -------------------------------- ### Start CLOG Builder with SBCL Source: https://github.com/rabbibotton/clog/blob/main/OCICL.md Launch the CLOG Builder using SBCL. This command loads the necessary CLOG tools and starts the builder application. For Windows, an additional eval is recommended. ```bash sbcl --userinit init --eval "(asdf:load-system :clog/tools)" --eval "(clog-tools:clog-builder :port 0 :app t)" ``` -------------------------------- ### Install SBCL on Linux Source: https://github.com/rabbibotton/clog/blob/main/OCICL.md Install SBCL using the system's package manager on Linux. This is a prerequisite for using OCICL and CLOG. ```bash sudo apt-get install sbcl ``` -------------------------------- ### Install SBCL Common Lisp Compiler Source: https://github.com/rabbibotton/clog/blob/main/MACOS.md Install the Steel Bank Common Lisp compiler (SBCL) using Homebrew. ```bash brew install sbcl ``` -------------------------------- ### Install Common Lisp Packages on Linux Source: https://github.com/rabbibotton/clog/blob/main/LINUX.md Installs the SBCL Common Lisp implementation, OpenSSH client, and SQLite development libraries. Adapt package names for your specific Linux distribution. ```bash sudo apt-get install sbcl openssh-client libsqlite3-dev ``` -------------------------------- ### Start CLOG Builder with SBCL on Windows Source: https://github.com/rabbibotton/clog/blob/main/OCICL.md This command is specifically for Windows users to start the CLOG Builder with SBCL. It includes an additional eval to set compile-file-failure-behaviour. ```bash sbcl --userinit init --eval "(setf asdf:*compile-file-failure-behaviour* :warn)" --eval "(asdf:load-system :clog/tools)" --eval "(clog-tools:clog-builder :port 0 :app t)" ``` -------------------------------- ### Window Collection Source: https://github.com/rabbibotton/clog/blob/main/doc/clog-manual.html Get the hash table of open windows. ```APIDOC ## WINDOW-COLLECTION ### Description Get hash table of open windows ### Generic Function Signature `WINDOW-COLLECTION` (CLOG-OBJ) ``` -------------------------------- ### Get CLOG Installation Directory Source: https://github.com/rabbibotton/clog/blob/main/doc/clog-manual.html Retrieve the installation directory for CLOG files. This is useful for locating source, tutorial, and demo files. ```common-lisp CL-USER> (clog:clog-install-dir) ``` -------------------------------- ### Grid Row Start Source: https://github.com/rabbibotton/clog/blob/main/doc/clog-manual.html Get or set the grid-row-start property for a CLOG element. ```APIDOC ## GRID-ROW-START ### Description Get/Setf grid-row-start. ### Method GET/SETF ### Endpoint N/A (CLOG Element Function) ``` -------------------------------- ### Grid Column Start Source: https://github.com/rabbibotton/clog/blob/main/doc/clog-manual.html Get or set the grid-column-start property for a CLOG element. ```APIDOC ## GRID-COLUMN-START ### Description Get/Setf grid-column-start. ### Method GET/SETF ### Endpoint N/A (CLOG Element Function) ``` -------------------------------- ### Load hello-builder with QuickLisp Source: https://github.com/rabbibotton/clog/blob/main/tutorial/28-tutorial/README.md Use this command to load the hello-builder system using QuickLisp. Ensure the hello-builder directory is in your QuickLisp search path. ```lisp (ql:quickload :hello-builder) ``` -------------------------------- ### Download QuickLisp Lisp File Source: https://github.com/rabbibotton/clog/blob/main/WINDOWS.md Use Git Bash to download the QuickLisp installer script. Ensure you are in your home directory before executing. ```bash cd curl -o /tmp/ql.lisp http://beta.quicklisp.org/quicklisp.lisp ``` -------------------------------- ### initialize Source: https://context7.com/rabbibotton/clog/llms.txt Starts the CLOG server, registers an on-new-window handler, and sets the static-file root. It accepts various keyword arguments to configure the server. ```APIDOC ## initialize — Start the CLOG server Starts the WebSocket/HTTP server, registers a handler called once per new browser connection (the "on-new-window" handler), and sets the static-file root. Accepts keyword arguments for host, port, server backend, SSL, long-polling, boot file, and middleware. ### Method (initialize on-new-window-handler &key port static-root ...) ### Parameters - **on-new-window-handler**: A function called for each new browser connection. - **:port**: The port number for the server (default 8080). - **:static-root**: The root directory for static files. ### Request Example ```lisp (ql:quickload :clog) (in-package :clog-user) (defun on-new-window (body) "Called every time a browser connects." (setf (title (html-document body)) "My App") (create-div body :content "Hello, CLOG!")) ;; Start server on default port 8080, open browser automatically (initialize #'on-new-window :port 8080 :static-root (merge-pathnames "www/" (uiop:getcwd))) (open-browser) ;; => browser opens http://127.0.0.1:8080/ ;; Register an additional route (set-on-new-window (lambda (body) (create-div body :content "About page")) :path "/about" :boot-file "/boot.html") ;; Shut down when done (shutdown) ``` ``` -------------------------------- ### Initialize CLOG GUI and Create Window Source: https://context7.com/rabbibotton/clog/llms.txt Installs the windowing system and creates a menu bar, an editable window, and dialog boxes. Requires `clog/tools`. ```lisp (ql:quickload :clog/tools) (use-package :clog-gui) (defun on-new-window (body) (clog-gui-initialize body) ; installs windowing system on this connection (add-class body "w3-light-grey") ;; Menu bar (let* ((mbar (create-gui-menu-bar body)) (file (create-gui-menu-drop-down mbar :content "File")) (_ (create-gui-menu-item file :content "New" :on-click (lambda (obj) (create-gui-window obj :title "New Doc" :width 400 :height 300)))) (_ (create-gui-menu-full-screen mbar))) (declare (ignore _))) ;; A window with content (let* ((win (create-gui-window body :title "Editor" :width 500 :height 350 :has-pinner t)) (area (create-child (window-content win) ""))) (declare (ignore area)) (window-center win) ;; Window events (set-on-window-close win (lambda (obj) (declare (ignore obj)) (alert-toast body "Window closed" "Editor was closed" :time-out 3))) (set-on-window-can-size win (lambda (obj) (declare (ignore obj)) t))) ; allow resize ;; Dialog boxes (confirm-dialog body "Save before exit?" (lambda (result) (if result (alert-dialog body "Saved!") (alert-toast body "Discarded" "Changes discarded" :time-out 2))) :ok-text "Save" :cancel-text "Discard") ;; Form dialog (form-dialog body "Register" '(("Name" "name" :text) ("Email" "email" :email) ("Role" "role" :select (("Admin" "admin") ("User" "user" :selected)))) (lambda (data) (format t "Got: ~A%" data)))) (initialize 'on-new-window) (open-browser) ``` -------------------------------- ### Install Homebrew Package Manager Source: https://github.com/rabbibotton/clog/blob/main/MACOS.md Install Homebrew, a package manager for macOS, which is used to install SBCL and other development tools. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` -------------------------------- ### Start CLOG Builder with QuickLisp Source: https://github.com/rabbibotton/clog/blob/main/doc/v5.md Load the CLOG builder using QuickLisp. Ensure QuickLisp is set up in your Lisp environment. ```lisp (ql:quickload :clog/tools)(clog-tools:clog-builder) ``` -------------------------------- ### Use Program Source: https://github.com/rabbibotton/clog/blob/main/doc/clog-manual.html Installs a program object as part of current WebGL rendering state. ```APIDOC ## USE-PROGRAM OBJ ### Description Installs a program object as part of current WebGL rendering state. ### Function Signature `USE-PROGRAM(OBJ)` ``` -------------------------------- ### Run CLOG Tutorial in CLOG Builder REPL Source: https://github.com/rabbibotton/clog/blob/main/tutorial/README.md To run a tutorial when using the CLOG Builder, open a CLOG Builder REPL and execute this command. ```lisp > (clog:run-tutorial 1) ``` -------------------------------- ### Load CLOG Application with QuickLisp Source: https://github.com/rabbibotton/clog/blob/main/tutorial/13-tutorial/README.md Use this command to load the 'hello-clog' application using QuickLisp. Ensure the project is in a directory searchable by QuickLisp. ```lisp (ql:quickload :hello-clog) ``` -------------------------------- ### Initialize CLOG REPL with Debugging Source: https://github.com/rabbibotton/clog/blob/main/doc/clog-manual.html Sets up a /repl path that opens a blank page, directing the CLOG user body to the REPL. Enables debug mode with console logging and initializes CLOG-web/GUI. Optionally initializes the CLOG debugger. ```lisp (clog-repl :clog-gui-initialize T :clog-web-initialize T :use-clog-debugger NIL :boot-file "/debug.html" :port 8080) ``` -------------------------------- ### CLOG App Setup and Event Handling Source: https://github.com/rabbibotton/clog/blob/main/README.md Defines a CLOG application package, sets up a handler for new windows, and configures an on-click event for a created div. ```lisp (defpackage #:clog-user ; 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 ;; Define our CLOG application (defun on-new-window (body) ; Define the function called on-new-window "On-new-window handler." (let ((hello-element ; hello-element is a local variable that ; will be bound to our new CLOG-Element ;; This application simply creates a CLOG-Element as a child to the ;; CLOG-body object in the browser window. ;; A CLOG-Element represents a block of HTML (we will later see ways to ;; directly create buttons and all sorts of HTML elements in more ;; lisp-like ways with no knowledge of HTML or JavaScript. (create-child body "