summary refs log tree commit diff
path: root/src/guile
diff options
context:
space:
mode:
authorLudovic Courtès2007-11-30 20:52:44 +0100
committerLudovic Courtès2007-11-30 20:52:44 +0100
commit7107f25eadbd5f42db99c8e1c557ab095a7e491d (patch)
tree012f2ef9b36e750b9433a8aed9996768ff4ddcf6 /src/guile
parent4283511c99e4da256587d3341655917a39052b31 (diff)
downloadskribilo-7107f25eadbd5f42db99c8e1c557ab095a7e491d.tar.gz
skribilo-7107f25eadbd5f42db99c8e1c557ab095a7e491d.tar.lz
skribilo-7107f25eadbd5f42db99c8e1c557ab095a7e491d.zip
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.
Diffstat (limited to 'src/guile')
-rw-r--r--src/guile/skribilo/engine/lout.scm16
1 files changed, 9 insertions, 7 deletions
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