From bb3c6d7d580aac172a44000625c46ec0ee7baea8 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 14 May 2012 00:57:07 +0200 Subject: 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. --- src/guile/skribilo/engine/info.scm | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'src') 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 ... */ -- cgit v1.2.3