From 07b598db06d28b017d38b4007f1e3cc6dbf62f6d Mon Sep 17 00:00:00 2001 From: "zuk (Jakob Krueger)" Date: Mon, 3 Mar 2025 20:18:45 +0400 Subject: [PATCH] Fix handling of 'alttitle' variable to support both strings and lists in csv --- toc_include.ly | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/toc_include.ly b/toc_include.ly index b3c6f39..4b93b0c 100644 --- a/toc_include.ly +++ b/toc_include.ly @@ -358,7 +358,7 @@ headerToTOC = #(define-music-function (parser location header label) (ly:book? s (songvars (cdr song)) (page-number (number->string (assoc-get (assq-ref songvars 'label) labelPageTable))) (extractedheadervars (extract-and-check-vars-from-header (assq-ref songvars 'header) - '(title starttext alttitle altalttitle categorytitle categories authors year_text year_melody year_translation year_composition infotext translation pronunciation copyright source))) + '(title starttext alttitle categorytitle categories authors year_text year_melody year_translation year_composition infotext translation pronunciation copyright source))) (headervar-or-empty (lambda (varsym) (let ((extracted (assq-ref extractedheadervars varsym))) (if extracted extracted "")))) @@ -378,8 +378,11 @@ headerToTOC = #(define-music-function (parser location header label) (ly:book? s page-number (headervar-or-empty 'title) (headervar-or-empty 'starttext) - (headervar-or-empty 'alttitle) - (headervar-or-empty 'altalttitle) + (let ((alttitle-value (headervar-or-empty 'alttitle))) + (if (list? alttitle-value) + (string-join alttitle-value ", ") ; Wenn eine Liste, dann zusammenfügen + alttitle-value)) ; Wenn kein Liste, den originalen Wert verwenden + (headervar-or-empty 'categorytitle) (headervar-or-empty 'categories) (format-authors (append poetIds (map car versePoetData))) @@ -404,7 +407,6 @@ headerToTOC = #(define-music-function (parser location header label) (ly:book? s "title" "starttext" "alttitle" - "altalttitle" "categorytitle" "categories" "poets"