;;;; Han-Wen Nienhuys <hanwen@xs4all.nl>
;;;;
;;;; LilyPond is free software: you can redistribute it and/or modify
;;;; Han-Wen Nienhuys <hanwen@xs4all.nl>
;;;;
;;;; LilyPond is free software: you can redistribute it and/or modify
(define-public (layout-extract-page-properties layout)
(list (append `((line-width . ,(ly:paper-get-number
(define-public (layout-extract-page-properties layout)
(list (append `((line-width . ,(ly:paper-get-number
-
- "Read variables WHAT-ODD, WHAT-EVEN from LAYOUT, and interpret them
-as markup. The PROPS argument will include variables set in SCOPES and
-page:is-bookpart-last-page, page:is-last-bookpart, page:page-number-string
-and page:page-number"
+ "Read variables @var{what-odd}, @var{what-even} from @var{layout},
+and interpret them as markup. The @var{props} argument will include
+variables set in @var{scopes} and @code{page:is-bookpart-last-page},
+@code{page:is-last-bookpart}, @code{page:page-number-string}, and
+@code{page:page-number}."
(define (get sym)
(ly:output-def-lookup layout sym))
(define (interpret-in-page-env potential-markup)
(if (markup? potential-markup)
(define (get sym)
(ly:output-def-lookup layout sym))
(define (interpret-in-page-env potential-markup)
(if (markup? potential-markup)
- (let* ((alists (map ly:module->alist scopes))
- (prefixed-alists
- (map (lambda (alist)
- (map (lambda (entry)
- (cons
- (string->symbol
- (string-append
- "header:"
- (symbol->string (car entry))))
- (cdr entry)))
- alist))
- alists))
- (pgnum-alist
- (list
- (cons 'header:tagline
- (ly:modules-lookup scopes 'tagline
- (ly:output-def-lookup layout 'tagline)))
- (cons 'page:is-last-bookpart is-last-bookpart)
- (cons 'page:is-bookpart-last-page is-bookpart-last-page)
- (cons 'page:page-number-string
- (number->string page-number))
- (cons 'page:page-number page-number)))
- (props (append
- (list pgnum-alist)
- prefixed-alists
- (layout-extract-page-properties layout))))
- (interpret-markup layout props potential-markup))
+ (let* ((alists (map ly:module->alist scopes))
+ (prefixed-alists
+ (map (lambda (alist)
+ (map (lambda (entry)
+ (cons
+ (string->symbol
+ (string-append
+ "header:"
+ (symbol->string (car entry))))
+ (cdr entry)))
+ alist))
+ alists))
+ (pgnum-alist
+ (list
+ (cons 'header:tagline
+ (ly:modules-lookup scopes 'tagline
+ (ly:output-def-lookup layout 'tagline)))
+ (cons 'page:is-last-bookpart is-last-bookpart)
+ (cons 'page:is-bookpart-last-page is-bookpart-last-page)
+ (cons 'page:page-number-string
+ (number->string page-number))
+ (cons 'page:page-number page-number)))
+ (props (append
+ (list pgnum-alist)
+ prefixed-alists
+ (layout-extract-page-properties layout))))
+ (interpret-markup layout props potential-markup))
+(export marked-up-headfoot)
+
+(define ((marked-up-title what) layout scopes)
+ "Read variables @var{what} from @var{scopes}, and interpret it as markup.
+The @var{props} argument will include variables set in @var{scopes} (prefixed
+with `header:'."
- (prefixed-alist
- (map (lambda (alist)
- (map (lambda (entry)
- (cons
- (string->symbol
- (string-append
- "header:"
- (symbol->string (car entry))))
- (cdr entry)))
- alist))
- alists))
- (props (append prefixed-alist
- (layout-extract-page-properties layout)))
+ (prefixed-alist
+ (map (lambda (alist)
+ (map (lambda (entry)
+ (cons
+ (string->symbol
+ (string-append
+ "header:"
+ (symbol->string (car entry))))
+ (cdr entry)))
+ alist))
+ alists))
+ (props (append prefixed-alist
+ (layout-extract-page-properties layout)))