2023-06-29 17:19:12 +02:00
|
|
|
(defpackage cl-sbt
|
2023-07-01 16:30:10 +02:00
|
|
|
(:use :cl)
|
2023-07-14 16:20:55 +02:00
|
|
|
(:export
|
2023-07-16 13:57:42 +02:00
|
|
|
:write-string-to-file
|
|
|
|
:with-page))
|
2023-07-01 16:30:10 +02:00
|
|
|
|
2023-06-29 17:19:12 +02:00
|
|
|
(in-package :cl-sbt)
|
2023-07-03 14:43:58 +02:00
|
|
|
|
2023-07-22 13:58:46 +02:00
|
|
|
(setq spinneret:*fill-column* 120)
|
2023-07-20 08:32:44 +02:00
|
|
|
(defparameter *cdn-css* "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css")
|
|
|
|
(defparameter *cdn-js* "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js")
|
|
|
|
|
2023-07-20 08:04:24 +02:00
|
|
|
(defmacro with-page ((&key cdn title) &body body)
|
2023-07-16 13:57:42 +02:00
|
|
|
`(spinneret:with-html
|
|
|
|
(:doctype)
|
|
|
|
(:html
|
|
|
|
(:head
|
2023-07-20 08:32:44 +02:00
|
|
|
(:meta :charset "utf-8")
|
|
|
|
(:meta :name "viewport" :content "width=device-width, initial-scale=1")
|
|
|
|
(:title ,title)
|
2023-07-20 08:04:24 +02:00
|
|
|
(if ,cdn
|
2023-07-20 08:32:44 +02:00
|
|
|
(:link :type "text/css" :rel "stylesheet" :href ,*cdn-css*)
|
2023-07-20 08:04:24 +02:00
|
|
|
(:link :type "text/css" :rel "stylesheet" :href "5.3.0/bootstrap.min.css")))
|
2023-07-17 09:04:34 +02:00
|
|
|
(:body ,@body)
|
2023-07-20 08:04:24 +02:00
|
|
|
(if ,cdn
|
2023-07-20 08:32:44 +02:00
|
|
|
(:script :src *cdn-js*)
|
2023-07-20 08:04:24 +02:00
|
|
|
(:script :src "5.3.0/bootstrap.bundle.min.js")))))
|
2023-07-16 13:57:42 +02:00
|
|
|
|
2023-07-16 11:36:30 +02:00
|
|
|
(defun write-string-to-file (filename string)
|
|
|
|
(with-open-file (stream filename :direction :output :if-exists :supersede)
|
|
|
|
(write-string string stream)))
|