From 084cb80f6e0eb60a9617ba7d571bcbd6bbf9a880 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 26 May 2009 23:22:35 +0200 Subject: doc: Improve `slide' example. * doc/user/src/slides.skb (Table of Contents): Rewrite using `resolve' so that the TOC isn't empty. Reported by James Haggerty . --- doc/user/src/slides.skb | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'doc') diff --git a/doc/user/src/slides.skb b/doc/user/src/slides.skb index dfc4572..391518b 100644 --- a/doc/user/src/slides.skb +++ b/doc/user/src/slides.skb @@ -5,14 +5,23 @@ :affiliation [The Organization] :address (ref :url "http://example.org/")) - (if (engine-format? "html") - (slide :title "Table of Contents" :number #f :toc #f - ;; HTML-specific table of contents. - (toc :chapter #f :section #f :subsection #f :subsubsection #f))) -;;; :slide #t))) - + (slide :title "Table of Contents" :number #f + + ;; "Manually" produce a list of the slides. This works by traversing + ;; the whole document tree, looking for `slide' nodes. + (p + (resolve (lambda (n e env) + (let ((slides (search-down (lambda (n) + (is-markup? n 'slide)) + (ast-document n)))) + (itemize + (map (lambda (n) + (item (ref :handle (handle n) + :text (markup-option n :text)))) + slides))))))) + (slide :title "Introduction" :vspace 0.3 - + (p [This is a simple slide, not grouped in any topic.])) (slide-topic :title "Interactive Features" :outline? #t -- cgit v1.2.3