From 7107f25eadbd5f42db99c8e1c557ab095a7e491d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 30 Nov 2007 20:52:44 +0100 Subject: lout: Fix `toc' to allow documentation building. * src/guile/skribilo/engine/lout.scm (toc): Use `*document-being-output*' if `(ast-document n)' is false. Use `find-down' instead of `search-down' when looking for chapters and sections. --- src/guile/skribilo/engine/lout.scm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/guile/skribilo/engine/lout.scm b/src/guile/skribilo/engine/lout.scm index 6be8546..a170d7c 100644 --- a/src/guile/skribilo/engine/lout.scm +++ b/src/guile/skribilo/engine/lout.scm @@ -1319,15 +1319,17 @@ :action (lambda (n e) (display "\n# toc\n") (if (markup-option n :chapter) - (let ((chapters (filter (lambda (n) - (or (is-markup? n 'chapter) - (is-markup? n 'slide))) - (markup-body (ast-document n))))) + (let* ((doc (or (ast-document n) + (*document-being-output*))) + (chapters (find-down (lambda (n) + (or (is-markup? n 'chapter) + (is-markup? n 'slide))) + doc))) (for-each (lambda (c) (let ((sections - (search-down (lambda (n) - (is-markup? n 'section)) - c))) + (find-down (lambda (n) + (is-markup? n 'section)) + c))) (lout-toc-entry c 0 e) (if (markup-option n :section) (for-each -- cgit v1.2.3