summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xget-cicadas-deps.sh24
-rw-r--r--src/hypnotisml.lisp9
-rw-r--r--src/package.lisp4
3 files changed, 34 insertions, 3 deletions
diff --git a/get-cicadas-deps.sh b/get-cicadas-deps.sh
new file mode 100755
index 0000000..bea0ebe
--- /dev/null
+++ b/get-cicadas-deps.sh
@@ -0,0 +1,24 @@
+LOCAL_PROJECTS=$1
+
+cd $LOCAL_PROJECTS
+
+if [ ! -d argot ]; then
+ git clone https://cicadas.surf/cgit/colin/argot.git
+else
+ cd argot && git checkout main && git pull origin main && cd ..;
+fi
+
+if [ ! -d def ]; then
+ git clone https://cicadas.surf/cgit/colin/def.git
+else
+ cd def && git checkout main && git pull origin main && cd ..;
+fi
+
+if [ ! -d ~/quicklisp/local-projects/hypnotisml ]; then
+ git clone https://cicadas.surf/cgit/colin/hypnotisml.git
+else
+ cd hypnotisml && git checkout main && git pull origin main && cd ..;
+fi
+
+
+
diff --git a/src/hypnotisml.lisp b/src/hypnotisml.lisp
index 13e4bab..adbb14d 100644
--- a/src/hypnotisml.lisp
+++ b/src/hypnotisml.lisp
@@ -4,9 +4,11 @@
;;; UTILITIES
+(def:var *noindent* :init nil :doc "Turns off indentation")
(def:var *indent* :doc "Current indentation" :init 0)
(defun indent (stream &optional (indent *indent*))
- (loop :repeat indent :do (write-char #\space stream)))
+ (unless *noindent*
+ (loop :repeat indent :do (write-char #\space stream))))
(let ((counter 0)
(hostid (sxhash (list (lisp-implementation-type)
@@ -263,6 +265,11 @@ already present in the element."
;;; RENDERING
+(defun html-string (elem &key (pretty t))
+ (let ((*noindent* (not pretty)))
+ (with-output-to-string (out)
+ (html elem out))))
+
(defgeneric html (elem stream)
(:documentation "Renders an element as HTML"))
diff --git a/src/package.lisp b/src/package.lisp
index 36d975b..4c0c94f 100644
--- a/src/package.lisp
+++ b/src/package.lisp
@@ -180,5 +180,5 @@
;; rendering
(:export
- #:html)
- )
+ #:html
+ #:html-string))