From a01e95f31ddad7f4aea30d65408c452d53f40405 Mon Sep 17 00:00:00 2001 From: Christoph Wagner Date: Fri, 19 Sep 2025 18:47:26 +0200 Subject: [PATCH] fix categories and authors index --- private_includes/book/toc_include.ily | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/private_includes/book/toc_include.ily b/private_includes/book/toc_include.ily index 3b26486..2ff802e 100644 --- a/private_includes/book/toc_include.ily +++ b/private_includes/book/toc_include.ily @@ -56,11 +56,11 @@ #(let ((index-item-list (list))) (set! add-index-item! - (lambda* (markup-symbol text sorttext #:optional (label (gensym "index"))) + (lambda* (markup-symbol textoptions sorttext #:optional (label (gensym "index"))) (set! index-item-list ;; We insert index items sorted from the beginning on and do ;; not sort them later - this saves pretty much computing time - (insert-alphabetical-sorted! (list label markup-symbol text + (insert-alphabetical-sorted! (list label markup-symbol textoptions ;; this crazy hack is necessary because lilypond depends on guile 1.8 atm ;; and so the cool unicode conversion functions cannot be used (ly:string-substitute " " "" @@ -92,20 +92,20 @@ (cons (car ilist) (insert-alphabetical-sorted! iitem (cdr ilist)))))) % code for category index -#(define*-public (add-category-index-item! categories markup-symbol text #:optional label) #f) +#(define*-public (add-category-index-item! categories markup-symbol textoptions #:optional label) #f) #(define-public (category-index-items) #f) #(let ((category-index-hash (make-hash-table))) (set! add-category-index-item! - (lambda* (categories markup-symbol text #:optional (label (gensym "index"))) + (lambda* (categories markup-symbol textoptions #:optional (label (gensym "index"))) (for-each (lambda (category) (let* ((catsym (string->symbol category)) (catlist (hashq-ref category-index-hash catsym - (list (list label 'indexCategoryMarkup category))))) + (list (list label 'indexCategoryMarkup `(((rawtext . ,category)))))))) (if (assq catsym category-names) (hashq-set! category-index-hash catsym - (cons (list label markup-symbol text) catlist)) - (ly:error "song: <~a> category ~a is not defined!" (markup->string text) category)))) + (cons (list label markup-symbol textoptions) catlist)) + (ly:error "song: <~a> category ~a is not defined!" (markup->string (chain-assoc-get 'rawtext textoptions)) category)))) categories) (make-music 'EventChord 'page-marker #t @@ -121,13 +121,13 @@ #(let ((author-index-hash (make-hash-table))) (set! add-author-index-item! - (lambda* (authorIDs markup-symbol text #:optional (label (gensym "index"))) + (lambda* (authorIDs markup-symbol textoptions #:optional (label (gensym "index"))) (for-each (lambda (authorID) (let* ((authorsym (string->symbol authorID)) (authorlist (hashq-ref author-index-hash authorsym - (list (list label 'indexAuthorMarkup authorID))))) + (list (list label 'indexAuthorMarkup `(((rawtext . ,authorID)))))))) (hashq-set! author-index-hash authorsym - (cons (list label markup-symbol text) authorlist)) + (cons (list label markup-symbol textoptions) authorlist)) )) authorIDs) (make-music 'EventChord