From ef0cd5b77e1ef6981b6cabb98397713597c5d990 Mon Sep 17 00:00:00 2001
From: paku <paku@skyizwhite.dev>
Date: Sat, 3 Feb 2024 13:57:35 +0900
Subject: [PATCH] Use flute instead of markup

---
 qlfile                |  2 +-
 qlfile.lock           |  8 ++++----
 src/routes/index.lisp | 20 ++++++++++----------
 src/ui/layout.lisp    | 24 +++++++++++-------------
 4 files changed, 26 insertions(+), 28 deletions(-)

diff --git a/qlfile b/qlfile
index 0e3a8ee..16af1e5 100644
--- a/qlfile
+++ b/qlfile
@@ -5,4 +5,4 @@ ql alexandria
 ql lack
 ql clack
 ql cl-jingle
-ql markup
+git flute https://github.com/skyizwhite/flute.git
diff --git a/qlfile.lock b/qlfile.lock
index 1133d72..2710411 100644
--- a/qlfile.lock
+++ b/qlfile.lock
@@ -30,7 +30,7 @@
  (:class qlot/source/ql:source-ql
   :initargs (:%version :latest)
   :version "ql-2023-10-21"))
-("markup" .
- (:class qlot/source/ql:source-ql
-  :initargs (:%version :latest)
-  :version "ql-2023-10-21"))
+("flute" .
+ (:class qlot/source/git:source-git
+  :initargs (:remote-url "https://github.com/skyizwhite/flute.git")
+  :version "git-a4bf72232f5de50b826d618f7b6ae0e75494e6f3"))
diff --git a/src/routes/index.lisp b/src/routes/index.lisp
index b40ce18..6181ac0 100644
--- a/src/routes/index.lisp
+++ b/src/routes/index.lisp
@@ -1,29 +1,29 @@
 (defpackage #:hp/routes/index
   (:use #:cl)
-  (:local-nicknames (#:mk #:markup))
+  (:local-nicknames (#:f #:flute))
   (:local-nicknames (#:jg #:jingle))
   (:local-nicknames (#:ui #:hp/ui/*))
   (:local-nicknames (#:utils #:hp/utils/*))
   (:export #:*index-app*))
 (in-package #:hp/routes/index)
 
-(mk:enable-reader)
-
 ;;; View
 
-(mk:deftag page ()
-  <ui:layout>
-    <section class="h-full flex justify-center items-center" >
-      <h1 class="text-4xl text-amber-500" >Hello HTMX from Common Lisp!</h1>
-    </section>
-  </ui:layout>)
+(f:define-element page ()
+  (f:h
+    (ui:layout
+     (section 
+      :class "h-full flex justify-center items-center"
+      (h1 
+       :class "text-4xl text-amber-500"
+       "Hello HTMX from Common Lisp!")))))
 
 ;;; Controller
 
 (defun index (params)
   (declare (ignore params))
   (jg:with-html-response
-    (mk:write-html <page />)))
+    (f:element-string (page))))
 
 (defparameter *index-app* (jg:make-app))
 
diff --git a/src/ui/layout.lisp b/src/ui/layout.lisp
index 6acc787..5b9f4f3 100644
--- a/src/ui/layout.lisp
+++ b/src/ui/layout.lisp
@@ -1,18 +1,16 @@
 (defpackage #:hp/ui/layout
   (:use #:cl)
-  (:local-nicknames (#:mk #:markup))
+  (:local-nicknames (#:f #:flute))
   (:export #:layout))
 (in-package #:hp/ui/layout)
 
-(markup:enable-reader)
-
-(mk:deftag layout (children)
-  <html>
-    <head>
-      <title>skyizwhite.dev</title>
-      <script src="/static/htmx.min.js" ></script>
-      <link href="/static/main.css" rel="stylesheet">
-      <link href="/static/tailwind.css" rel="stylesheet">
-    </head>
-    <body class="h-[100svh]" >,@(progn children)</body>
-  </html>)
+(f:define-element layout ()
+  (f:h
+    (html
+     (head
+      (title "skyizwhite.dev")
+      (script :src "/static/htmx.min.js")
+      (link :href "/static/main.css" :rel "stylesheet")
+      (link :href "/static/tailwind.css" :rel "stylesheet"))
+     (body :class "h-[100svh]"
+           f:children))))