what if we sexp'd the css too
is this good (also, sorted the imports for no important reason)
This commit is contained in:
parent
f315cd9237
commit
8fb927143f
1 changed files with 51 additions and 49 deletions
82
main.scm
82
main.scm
|
@ -1,21 +1,23 @@
|
|||
#!/usr/bin/csi -s
|
||||
|
||||
(import utf8
|
||||
lowdown
|
||||
(chicken string)
|
||||
(chicken port)
|
||||
(import
|
||||
(chicken file)
|
||||
(chicken format)
|
||||
(chicken io)
|
||||
(chicken pathname)
|
||||
(chicken port)
|
||||
(chicken process)
|
||||
(chicken process-context)
|
||||
(chicken format)
|
||||
(chicken pathname)
|
||||
(chicken file)
|
||||
sxml-transforms
|
||||
(chicken string)
|
||||
(clojurian syntax)
|
||||
scss
|
||||
lowdown
|
||||
srfi-1 ;; list utils
|
||||
srfi-13 ;; string utils
|
||||
srfi-14 ;; charsets
|
||||
sxml-transforms
|
||||
symbol-utils ;; (unspecified-value)
|
||||
utf8
|
||||
)
|
||||
|
||||
(define CLONE-URL (or (get-environment-variable "REPO2HTML_CLONE_URL") "git://git.example.com"))
|
||||
|
@ -68,37 +70,37 @@
|
|||
|
||||
;; main code ---------------------------------
|
||||
|
||||
(define css "
|
||||
body {
|
||||
margin: 0 auto;
|
||||
max-width: 700px;
|
||||
}
|
||||
pre, code {
|
||||
background-color: #ffd9df;
|
||||
}
|
||||
pre {
|
||||
padding: 15px 20px;
|
||||
white-space: pre;
|
||||
overflow: scroll;
|
||||
}
|
||||
a { color: blue; }
|
||||
nav a { margin-right: 10px; }
|
||||
hr {
|
||||
border:0;
|
||||
border-bottom: 1px solid black;
|
||||
margin-top: 16px;
|
||||
}
|
||||
td {
|
||||
padding: 0em .5em;
|
||||
vertical-align: top;
|
||||
}
|
||||
footer {
|
||||
text-align: right;
|
||||
font-size: small;
|
||||
}
|
||||
#file-path {
|
||||
/* change this to your liking */
|
||||
}")
|
||||
(define mycss
|
||||
(with-output-to-string
|
||||
(lambda ()
|
||||
(write-css
|
||||
'(css
|
||||
(body
|
||||
(margin 0 auto)
|
||||
(max-width 700px))
|
||||
(((pre) (code))
|
||||
(background-color "#ffd9df"))
|
||||
(pre
|
||||
(overflow scroll)
|
||||
(padding 15px 20px)
|
||||
(white-space pre))
|
||||
(a
|
||||
(color blue))
|
||||
((nav a)
|
||||
(margin-right 10px))
|
||||
(hr
|
||||
(border 0)
|
||||
(border-bottom 1px solid black)
|
||||
(margin-top 16px))
|
||||
(td
|
||||
(padding 0em .5em)
|
||||
(vertical-align top))
|
||||
(footer
|
||||
(font-size small)
|
||||
(text-align right))
|
||||
((= id file-path)
|
||||
;; change this to your liking
|
||||
))))))
|
||||
|
||||
(define (make-sxml-template-wrapper repository-name source-files-list)
|
||||
(let ((readme-file
|
||||
|
@ -119,7 +121,7 @@
|
|||
(meta (@ (name viewport) (content "width=device-width, initial-scale-1.0, user-scalable=yes")))
|
||||
(link (@ (rel icon) (href "data:,")))
|
||||
(meta (@ (name description) (content ,DESCRIPTION)))
|
||||
(style ,css))
|
||||
(style ,mycss))
|
||||
(body
|
||||
(h1 ,H1)
|
||||
(h2 ,repository-name)
|
||||
|
|
Loading…
Reference in a new issue