X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=ly%2Ftoc-init.ly;h=32eeb462f8e77e0f3893058708334d68ddafc2b9;hb=c2c8b597ae34623134a772b9fd66f384ba4d95a9;hp=488e22ba2a6eb823a43f048dac5bdcfef344abec;hpb=6a4a699484ac521b9d0249623e1028e56f2c938a;p=lilypond.git diff --git a/ly/toc-init.ly b/ly/toc-init.ly index 488e22ba2a..32eeb462f8 100644 --- a/ly/toc-init.ly +++ b/ly/toc-init.ly @@ -1,4 +1,4 @@ -\version "2.12.0" +\version "2.16.0" %% defined later, in a closure #(define-public (add-toc-item! markup-symbol text) @@ -7,6 +7,7 @@ #f) #(let ((toc-item-list (list))) + (call-after-session (lambda () (set! toc-item-list '()))) (set! add-toc-item! (lambda (markup-symbol text) (let ((label (gensym "toc"))) @@ -24,7 +25,7 @@ \paper { tocTitleMarkup = \markup \huge \column { \fill-line { \null "Table of Contents" \null } - \hspace #1 + \null } tocItemMarkup = \markup \fill-line { \fromproperty #'toc:text \fromproperty #'toc:page @@ -38,7 +39,7 @@ tocItemWithDotsMarkup = \markup \fill-with-pattern #1 #RIGHT . ( _i "Outputs the table of contents, using the paper variable @code{tocTitleMarkup} for its title, then the list of lines built using the @code{tocItem} music function -Usage: @code{\\markuplines \\table-of-contents}" ) +Usage: @code{\\markuplist \\table-of-contents}" ) (cons (interpret-markup layout props (ly:output-def-lookup layout 'tocTitleMarkup)) (space-lines (chain-assoc-get 'baseline-skip props) @@ -48,9 +49,10 @@ Usage: @code{\\markuplines \\table-of-contents}" ) (text (caddr toc-item))) (interpret-markup layout - (cons (list (cons 'toc:page - (markup #:page-ref label "XXX" "?")) - (cons 'toc:text text)) + (cons (list (cons 'toc:page + (markup #:with-link label #:page-ref label "XXX" "?")) + (cons 'toc:text (markup #:with-link label text)) + (cons 'toc:label label)) props) (ly:output-def-lookup layout toc-markup)))) (toc-items)))))