78 lines
		
	
	
		
			4.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			78 lines
		
	
	
		
			4.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| \paper {
 | ||
|   poetPrefix = "Worte:"
 | ||
|   composerPrefix = "Weise:"
 | ||
|   compositionPrefix = "Satz:"
 | ||
|   adaptionTextPrefix = "Bearbeitung Text:"
 | ||
|   adaptionMusicPrefix = "Bearbeitung Musik:"
 | ||
|   poetAndComposerEqualPrefix = "Worte und Weise:"
 | ||
|   voicePrefix = "Stimme:"
 | ||
|   versePrefix = "Strophe:"
 | ||
|   translationAuthorPrefix = "Übersetzung:"
 | ||
|   translationPrefix = "Übersetzung:"
 | ||
|   pronunciationPrefix = "Aussprache:"
 | ||
|   interludePrefix = "Zwischenspiel:"
 | ||
|   bridgePrefix = "Bridge:"
 | ||
| 
 | ||
|   authorFormat =
 | ||
|     #(lambda (noDetails name trail_name birth_year death_year organization)
 | ||
|         (let ((string-present (lambda (str) (and str (not (and (string? str) (string-null? str))))))
 | ||
|               (render_informations (lambda (infolist) (string-append (car infolist) (if (or noDetails (null? (cdr infolist))) "" (string-append " (" (string-join (cdr infolist) ", ") ")"))))))
 | ||
|             (if (or (string-present trail_name) (string-present name))
 | ||
|               (render_informations (filter string-present (list
 | ||
|                 trail_name
 | ||
|                 name
 | ||
|                 (if (and (string-present birth_year) (string-present death_year))
 | ||
|                   (ly:format "~a‒~a" birth_year death_year)
 | ||
|                   (if (string-present birth_year)
 | ||
|                     (ly:format "*~a" birth_year)
 | ||
|                     (if (string-present death_year) (ly:format "†~a" death_year) "")))
 | ||
|                 organization
 | ||
|               )))
 | ||
|               ""
 | ||
|           )))
 | ||
| 
 | ||
|   songinfoMarkup =
 | ||
|     #(make-on-the-fly-markup
 | ||
|       (lambda (layout props m)
 | ||
|         (let* ((between-poet-and-composer-markup (chain-assoc-get 'header:between-poet-and-composer-markup props (make-hspace-markup 3)))
 | ||
|               (poet-maybe-with-composer (chain-assoc-get 'songinfo:poet-maybe-with-composer props #f))
 | ||
|               (composer (chain-assoc-get 'songinfo:composer props #f))
 | ||
|               (copyright (chain-assoc-get 'songinfo:copyright props #f))
 | ||
|               (infotext (chain-assoc-get 'songinfo:infotext props #f))
 | ||
|               (translation (chain-assoc-get 'songinfo:translation props #f))
 | ||
|               (pronunciation (chain-assoc-get 'songinfo:pronunciation props #f))
 | ||
|               (year_text (chain-assoc-get 'songinfo:year_text props #f))
 | ||
|               (year_melody (chain-assoc-get 'songinfo:year_melody props #f))
 | ||
|               (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))
 | ||
|               (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 "\r?\n[ \t\r\n]*\n[ \t\r\n]*") (string-append prefix text))))
 | ||
|                   '())))
 | ||
|               (poet-and-composer-markup-list
 | ||
|                 (string-with-paragraphs->markuplist "" (string-append
 | ||
|                   (if poet-with-year (string-append "\n\n" poet-with-year) "")
 | ||
|                   (if composer-with-year (string-append "\n\n" composer-with-year) "")
 | ||
|                 )))
 | ||
|               (poet-and-composer-oneliner (if (and poet-with-year composer-with-year) (make-line-markup (cons (cadr poet-and-composer-markup-list) (cons between-poet-and-composer-markup (cddr poet-and-composer-markup-list)))) #f))
 | ||
|               (current-line-width (chain-assoc-get 'line-width props (ly:output-def-lookup layout 'line-width))))
 | ||
|           (stack-lines DOWN 0.0 (chain-assoc-get 'baseline-skip props)
 | ||
|             (interpret-markup-list layout props
 | ||
|               (append
 | ||
|                 (if (and poet-and-composer-oneliner (< (interval-length (ly:stencil-extent (interpret-markup layout props poet-and-composer-oneliner) X)) current-line-width))
 | ||
|                   (list poet-and-composer-oneliner)
 | ||
|                   poet-and-composer-markup-list)
 | ||
|                 (string-with-paragraphs->markuplist "" (string-append
 | ||
|                   (if copyright (string-append "\n\n© " copyright) "")))
 | ||
|                 (string-with-paragraphs->markuplist "" infotext)
 | ||
|                 (string-with-paragraphs->markuplist (string-append (ly:output-def-lookup layout 'translationPrefix) " ") translation)
 | ||
|                 (string-with-paragraphs->markuplist (string-append (ly:output-def-lookup layout 'pronunciationPrefix) " ") pronunciation)
 | ||
|                   )))))
 | ||
|       (make-null-markup)
 | ||
|     )
 | ||
| } |