aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoris2024-01-05 10:39:24 +0100
committerJoris2024-01-05 10:39:24 +0100
commit0d97631eb0c8b1459a23e8e003705502754969d1 (patch)
tree79ff0fafe2f82d8342ffb6a3d1c325d76f5ee4b5 /src
parent8b5a1f5b754d51147236c7a50e573d4b041497ee (diff)
Allow to specify chord multiplier
Diffstat (limited to 'src')
-rw-r--r--src/main.lisp23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/main.lisp b/src/main.lisp
index d2090e5..2d3007e 100644
--- a/src/main.lisp
+++ b/src/main.lisp
@@ -71,7 +71,7 @@
(if
(eql key 'all)
nil
- (h "h3" nil (list (part-name key))))
+ (h "h3" '(("class" "g-Part__Title")) (list (part-name key))))
children)))
; Chords
@@ -109,17 +109,26 @@
nil
(cons (chord-row (car xs)) (chord-rows (cdr xs)))))
-(defun chord-table (key row)
- (part-tags
- key
- (h "table" '(("class" "g-Chords__Table")) (chord-rows row))))
+(defun chord-table (key x)
+ (let* ((is-repeat (eql (car x) :repeat))
+ (n (if is-repeat (second x) 1))
+ (rows (if is-repeat (cddr x) x)))
+ (part-tags
+ key
+ (h
+ "div"
+ '(("class" "g-Chords__Section"))
+ (list
+ (h "table" '(("class" "g-Chords__Table")) (chord-rows rows))
+ (if (> n 1) (h "div" '(("class" "g-Chords__Multiplier")) (list (write-to-string n))) nil))))))
+
(defun chord-tables (xs)
(if
(eql xs nil)
nil
- (let ((key (car (car xs)))
- (rows (cdr (car xs))))
+ (let ((key (caar xs))
+ (rows (cdar xs)))
(cons (chord-table key rows) (chord-tables (cdr xs))))))
(defun chord-tags (chords tonality)