aboutsummaryrefslogtreecommitdiff
path: root/src/guile
diff options
context:
space:
mode:
authorLudovic Courtès2012-05-14 00:57:07 +0200
committerLudovic Courtès2012-05-14 01:02:48 +0200
commitbb3c6d7d580aac172a44000625c46ec0ee7baea8 (patch)
tree78e6594618c9028ffb0b12640c124b7747f57338 /src/guile
parent588770e376ff8f6f070ee1b4b75b3f81ab632ad6 (diff)
downloadskribilo-bb3c6d7d580aac172a44000625c46ec0ee7baea8.tar.gz
skribilo-bb3c6d7d580aac172a44000625c46ec0ee7baea8.tar.lz
skribilo-bb3c6d7d580aac172a44000625c46ec0ee7baea8.zip
info: Produce a menu consistent with the document structure.
* src/guile/skribilo/engine/info.scm (node-menu): Use `node-children' instead of `markup-body'. Output any node that matches `%block?', not just chapters and sections.
Diffstat (limited to 'src/guile')
-rw-r--r--src/guile/skribilo/engine/info.scm25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/guile/skribilo/engine/info.scm b/src/guile/skribilo/engine/info.scm
index 9b19de5..bceb796 100644
--- a/src/guile/skribilo/engine/info.scm
+++ b/src/guile/skribilo/engine/info.scm
@@ -132,21 +132,16 @@
;* node-menu ... */
;*---------------------------------------------------------------------*/
(define (node-menu container e)
- (let ((children (markup-body container)))
- (if (pair? (filter (lambda (x)
- (and (markup? x)
- (memq (markup-markup x)
- '(chapter section))))
- children))
- (begin
- (newline)
- (print "* Menu:")
- (newline)
- (for-each (lambda (c)
- (if (%block? c)
- (print "* " (block-title c e) "::")))
- children)))
- (newline)))
+ (let ((children (filter %block? (node-children container))))
+ (if (pair? children)
+ (begin
+ (newline)
+ (print "* Menu:")
+ (newline)
+ (for-each (lambda (c)
+ (print "* " (block-title c e) "::"))
+ children)))
+ (newline)))
;*---------------------------------------------------------------------*/
;* block-title ::%chapter ... */