Style section headers
This commit is contained in:
parent
a63f41c2ef
commit
a7d486f090
@ -3,8 +3,6 @@
|
||||
◊title{A DSL for Music}
|
||||
◊published-date[2018 8 5]
|
||||
|
||||
◊;; TODO add author and date
|
||||
|
||||
◊section{Haskell School of Music}
|
||||
|
||||
I recently discovered Haskell School of Music. It’s a book about algorithmic music, which is awesome because: a) I’ve been obsessed with procedural generation for years and b) I like music as much as I like programming. So you can imagine my excitement when I discovered that someone had written a textbook combining my favorite areas of study.
|
||||
|
@ -11,6 +11,12 @@
|
||||
(define (zip-kws kws kw-args)
|
||||
(map list (map string->symbol (map keyword->string kws)) kw-args))
|
||||
|
||||
(define (with-class attrs cls)
|
||||
(let ((existing-cls (assoc 'class attrs)))
|
||||
(dict-set attrs 'class (if existing-cls
|
||||
(list (string-append (cadr existing-cls) " " cls))
|
||||
(list cls)))))
|
||||
|
||||
(define title
|
||||
(make-keyword-procedure
|
||||
(lambda (kws kw-args . elements)
|
||||
@ -19,7 +25,7 @@
|
||||
(define section
|
||||
(make-keyword-procedure
|
||||
(lambda (kws kw-args . elements)
|
||||
(txexpr 'h2 (zip-kws kws kw-args) elements))))
|
||||
(txexpr 'h2 (with-class (zip-kws kws kw-args) "section-header") elements))))
|
||||
|
||||
(define link
|
||||
(make-keyword-procedure
|
||||
|
@ -71,3 +71,7 @@ pre > code.hljs {
|
||||
float: left;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user