diff options
author | Ludovic Courtès | 2009-05-26 23:22:35 +0200 |
---|---|---|
committer | Ludovic Courtès | 2009-05-26 23:22:35 +0200 |
commit | 084cb80f6e0eb60a9617ba7d571bcbd6bbf9a880 (patch) | |
tree | 9f14ce29822ad0d224d976448d756f881397a942 /doc/user/src/slides.skb | |
parent | d0425ffc943f791f8bc71eff9b8cb355b5559bea (diff) | |
download | skribilo-084cb80f6e0eb60a9617ba7d571bcbd6bbf9a880.tar.gz skribilo-084cb80f6e0eb60a9617ba7d571bcbd6bbf9a880.tar.lz skribilo-084cb80f6e0eb60a9617ba7d571bcbd6bbf9a880.zip |
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
<james.haggerty@gmail.com>.
Diffstat (limited to 'doc/user/src/slides.skb')
-rw-r--r-- | doc/user/src/slides.skb | 23 |
1 files changed, 16 insertions, 7 deletions
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 |