diff --git a/FAQ b/FAQ index d73ea6a..8a15af9 100644 --- a/FAQ +++ b/FAQ @@ -8,13 +8,15 @@ Q) How do I turn my CLOG app in to a native Mac, Windows or Linux app? A) There are many ways, the simplest is just use Ceramic - http://ceramic.github.io/ which uses electron. You can of course use any -tool the gives you a browser control. See clog/nativ-glues/gtk or an example +tool the gives you a browser control. See clog/native-glues/gtk or an example with GTK in C, but you can use the cl-cffi-gtk to accomplish the same thing. 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) + Q) I want to know where the :CLOG tutorials, demos and sources. -Use (asdf:system-source-directory :clog) +Use (clog-install-dir) diff --git a/doc/clog-manual.html b/doc/clog-manual.html index 18b4646..e2a2336 100644 --- a/doc/clog-manual.html +++ b/doc/clog-manual.html @@ -514,7 +514,7 @@ alpha 0.0 - 1.0

  • [class] CLOG-OBJ

    CLOG objects (clog-obj) encapsulate the connection between -lisp and the HTML DOM element.

  • +lisp and an HTML DOM element.

    CLOG-Obj - General Properties

    @@ -6330,6 +6330,14 @@ If ON-FULL-SCREEN-CHANGE-HANDLER is nil unbind the event.

    clog-user:body to last window openned to /repl.

    +

    + + +

    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)