From d47ae1a66d0c3aba83ef2d29d010919293ad98cd Mon Sep 17 00:00:00 2001 From: tux Date: Sat, 26 Apr 2025 21:29:01 +0200 Subject: [PATCH] interpret songinfo with markups --- default_songinfo_style.ly | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/default_songinfo_style.ly b/default_songinfo_style.ly index fbe8ef8..b6adb29 100644 --- a/default_songinfo_style.ly +++ b/default_songinfo_style.ly @@ -42,7 +42,16 @@ (poet-with-year (if (and poet-maybe-with-composer year_text) (string-append poet-maybe-with-composer ", " year_text) poet-maybe-with-composer)) (composer-with-year (if (and composer year_melody) (string-append composer ", " year_melody) composer)) (poet-and-composer-oneliner (if (and poet-with-year composer-with-year) (markup poet-with-year between-poet-and-composer-markup composer-with-year) #f)) - (current-line-width (chain-assoc-get 'line-width props (ly:output-def-lookup layout 'line-width)))) + (current-line-width (chain-assoc-get 'line-width props (ly:output-def-lookup layout 'line-width))) + (string-with-paragraphs->markuplist (lambda (prefix text) + (if text + (apply append + (map + (lambda (paragraph) + (make-wordwrap-internal-markup-list #t + #{ \markuplist { $(ly:parser-include-string paragraph) } #})) + (ly:regex-split (ly:make-regex "\n[ \t\n]*\n[ \t\n]*") text))) + '())))) (stack-lines DOWN 0.0 (chain-assoc-get 'baseline-skip props) (interpret-markup-list layout props (append @@ -53,10 +62,11 @@ (if composer-with-year (string-append "\n\n" composer-with-year) "") ))) (make-wordwrap-string-internal-markup-list #t (string-append - (if copyright (string-append "\n\n© " copyright) "") - (if infotext (string-append "\n\n" infotext) "") - (if translation (string-append "\n\nÜbersetzung: " translation) "") - (if pronunciation (string-append "\n\nAussprache: " pronunciation) "")))))))) + (if copyright (string-append "\n\n© " copyright) ""))) + (string-with-paragraphs->markuplist "" infotext) + (string-with-paragraphs->markuplist "Übersetzung: " translation) + (string-with-paragraphs->markuplist "Aussprache: " pronunciation) + ))))) (make-null-markup) ) } \ No newline at end of file