what if we sexp'd the css too

is this good

(also, sorted the imports for no important reason)
This commit is contained in:
pho4cexa 2022-12-12 21:34:09 -08:00 committed by m455
parent f315cd9237
commit 8fb927143f

100
main.scm
View file

@ -1,22 +1,24 @@
#!/usr/bin/csi -s #!/usr/bin/csi -s
(import utf8 (import
lowdown (chicken file)
(chicken string) (chicken format)
(chicken port) (chicken io)
(chicken io) (chicken pathname)
(chicken process) (chicken port)
(chicken process-context) (chicken process)
(chicken format) (chicken process-context)
(chicken pathname) (chicken string)
(chicken file) (clojurian syntax)
sxml-transforms scss
(clojurian syntax) lowdown
srfi-1 ;; list utils srfi-1 ;; list utils
srfi-13 ;; string utils srfi-13 ;; string utils
srfi-14 ;; charsets srfi-14 ;; charsets
symbol-utils ;; (unspecified-value) sxml-transforms
) symbol-utils ;; (unspecified-value)
utf8
)
(define CLONE-URL (or (get-environment-variable "REPO2HTML_CLONE_URL") "git://git.example.com")) (define CLONE-URL (or (get-environment-variable "REPO2HTML_CLONE_URL") "git://git.example.com"))
(define TITLE (or (get-environment-variable "REPO2HTML_TITLE") "my git repositories")) (define TITLE (or (get-environment-variable "REPO2HTML_TITLE") "my git repositories"))
@ -68,37 +70,37 @@
;; main code --------------------------------- ;; main code ---------------------------------
(define css " (define mycss
body { (with-output-to-string
margin: 0 auto; (lambda ()
max-width: 700px; (write-css
} '(css
pre, code { (body
background-color: #ffd9df; (margin 0 auto)
} (max-width 700px))
pre { (((pre) (code))
padding: 15px 20px; (background-color "#ffd9df"))
white-space: pre; (pre
overflow: scroll; (overflow scroll)
} (padding 15px 20px)
a { color: blue; } (white-space pre))
nav a { margin-right: 10px; } (a
hr { (color blue))
border:0; ((nav a)
border-bottom: 1px solid black; (margin-right 10px))
margin-top: 16px; (hr
} (border 0)
td { (border-bottom 1px solid black)
padding: 0em .5em; (margin-top 16px))
vertical-align: top; (td
} (padding 0em .5em)
footer { (vertical-align top))
text-align: right; (footer
font-size: small; (font-size small)
} (text-align right))
#file-path { ((= id file-path)
/* change this to your liking */ ;; change this to your liking
}") ))))))
(define (make-sxml-template-wrapper repository-name source-files-list) (define (make-sxml-template-wrapper repository-name source-files-list)
(let ((readme-file (let ((readme-file
@ -119,7 +121,7 @@
(meta (@ (name viewport) (content "width=device-width, initial-scale-1.0, user-scalable=yes"))) (meta (@ (name viewport) (content "width=device-width, initial-scale-1.0, user-scalable=yes")))
(link (@ (rel icon) (href "data:,"))) (link (@ (rel icon) (href "data:,")))
(meta (@ (name description) (content ,DESCRIPTION))) (meta (@ (name description) (content ,DESCRIPTION)))
(style ,css)) (style ,mycss))
(body (body
(h1 ,H1) (h1 ,H1)
(h2 ,repository-name) (h2 ,repository-name)