From fdd94960e18a33e5522dadbca718cc51f5bc42a5 Mon Sep 17 00:00:00 2001
From: David Botton
[class] CLOG-OBJ
CLOG objects (clog-obj) encapsulate the connection between
-lisp and the HTML DOM element.
HTML DOM element.
CLOG-Obj - General Properties
@@ -6330,6 +6330,14 @@ IfON-FULL-SCREEN-CHANGE-HANDLER is nil unbind the event.
clog-user:body to last window openned to /repl.
+
+
+[function] SAVE-BODY-TO-FILE FILE-NAME &KEY (BODY CLOG-USER::*BODY*) (IF-EXISTS :ERROR) IF-DOES-NOT-EXIST EXTERNAL-FORMAT
Save the current html of BODY in the current state to FILE-NAME
Functions for Compilation and Documentation
diff --git a/source/clog-helpers.lisp b/source/clog-helpers.lisp index 3c97574..06baed0 100644 --- a/source/clog-helpers.lisp +++ b/source/clog-helpers.lisp @@ -92,7 +92,24 @@ clog-user:*body* to last window openned to /repl." :path "/repl") (open-browser :url "http://127.0.0.1:8080/repl") (format t "Use clog-user:*body* to access the clog-repl window.")) - + +;;;;;;;;;;;;;;;;;;;;;;; +;; save-body-to-file ;; +;;;;;;;;;;;;;;;;;;;;;;; + +(defun save-body-to-file (file-name &key (body clog-user::*body*) + (if-exists :error) + if-does-not-exist + external-format) + "Save the current html of BODY in the current state to FILE-NAME" + (when (alexandria:write-string-into-file + (outer-html (document-element (html-document body))) + file-name + :if-exists if-exists + :if-does-not-exist if-does-not-exist + :external-format external-format) + t)) + ;;;;;;;;;;;;;;;; ;; load-world ;; ;;;;;;;;;;;;;;;; diff --git a/source/clog.lisp b/source/clog.lisp index a411728..558afc2 100644 --- a/source/clog.lisp +++ b/source/clog.lisp @@ -784,13 +784,14 @@ embedded in a native template application.)" (defsection @clog-helpers (:title "CLOG Helper Functions") "Tutorial and demo helpers" - (clog-install-dir function) - (open-manual function) - (run-tutorial function) - (load-tutorial function) - (run-demo function) - (load-demo function) - (clog-repl function) + (clog-install-dir function) + (open-manual function) + (run-tutorial function) + (load-tutorial function) + (run-demo function) + (load-demo function) + (clog-repl function) + (save-body-to-file function) "Functions for Compilation and Documentation" (load-world function)