From 6b1715f3f4a1d3718d5ec4eebc2f04023e9564be Mon Sep 17 00:00:00 2001 From: Ludovic Court`es Date: Thu, 24 Aug 2006 13:29:54 +0000 Subject: slide: Added a `:class' argument to (sub)topics. * src/guile/skribilo/package/slide.scm (slide-topic): Added a `class' argument. Specified the required options. (slide-subtopic): Likewise. * src/guile/skribilo/package/slide/base.scm (make-topic-slide): Renamed to `make-outline-slide'. Pass `:class' with the topic's class to `slide'. (slide-topic): Added `:options'. (slide-subtopic): New writer. * src/guile/skribilo/package/slide/html.scm (slide-topic): Added `:options'. git-archimport-id: lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-45 --- src/guile/skribilo/package/slide.scm | 8 ++++++-- src/guile/skribilo/package/slide/base.scm | 17 ++++++++++++++--- src/guile/skribilo/package/slide/html.scm | 1 + 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/guile/skribilo/package/slide.scm b/src/guile/skribilo/package/slide.scm index 5a5f73d..380fdc5 100644 --- a/src/guile/skribilo/package/slide.scm +++ b/src/guile/skribilo/package/slide.scm @@ -226,9 +226,11 @@ ;* slide-topic ... */ ;*---------------------------------------------------------------------*/ (define-markup (slide-topic #!rest opt - #!key (outline? #t) (title "") (ident #f)) + #!key title (outline? #t) + (ident #f) (class "slide-topic")) (new container (markup 'slide-topic) + (required-options '(:title :outline?)) (ident (or ident (symbol->string (gensym 'slide-topic)))) (options (the-options opt)) (body (the-body opt)))) @@ -237,9 +239,11 @@ ;* slide-subtopic ... */ ;*---------------------------------------------------------------------*/ (define-markup (slide-subtopic #!rest opt - #!key (outline? #f) (title "") (ident #f)) + #!key title (outline? #f) + (ident #f) (class "slide-subtopic")) (new container (markup 'slide-subtopic) + (required-options '(:title :outline?)) (ident (or ident (symbol->string (gensym 'slide-subtopic)))) (options (the-options opt)) (body (the-body opt)))) diff --git a/src/guile/skribilo/package/slide/base.scm b/src/guile/skribilo/package/slide/base.scm index 8c95881..c8e652c 100644 --- a/src/guile/skribilo/package/slide/base.scm +++ b/src/guile/skribilo/package/slide/base.scm @@ -137,7 +137,7 @@ ;; Title for the automatically-generated outline slide. (define %slide-outline-title "") -;; Circular list of symbols to be passed to `itemize' in pointers. +;; Circular list of symbols to be passed to `itemize' in outlines. (define %slide-outline-itemize-symbols (let loop ((names '(#t "-" "bullet" "->" "middot"))) (if (null? names) @@ -148,13 +148,14 @@ (loop (cdr names)))))) -(define (make-topic-slide topic engine) +(define (make-outline-slide topic engine) (let ((parent-topic (if (is-markup? topic 'slide-topic) topic (find1-up (lambda (n) (is-markup? n 'slide-topic)) topic)))) (output (slide :title %slide-outline-title :toc #f + :class (markup-option topic :class) ;; The mark below is needed for cross-referencing by PDF ;; bookmarks. (if (markup-ident topic) (mark (markup-ident topic)) "") @@ -164,9 +165,19 @@ (markup-writer 'slide-topic (find-engine 'base) + :options '(:title :outline? :class :ident) :action (lambda (n e) (if (markup-option n :outline?) - (make-topic-slide n e)) + (make-outline-slide n e)) + + (output (markup-body n) e))) + +(markup-writer 'slide-subtopic (find-engine 'base) + ;; FIXME: Largely untested. + :options '(:title :outline? :class :ident) + :action (lambda (n e) + (if (markup-option n :outline?) + (make-outline-slide n e)) (output (markup-body n) e))) diff --git a/src/guile/skribilo/package/slide/html.scm b/src/guile/skribilo/package/slide/html.scm index ef2642b..d47ef82 100644 --- a/src/guile/skribilo/package/slide/html.scm +++ b/src/guile/skribilo/package/slide/html.scm @@ -110,6 +110,7 @@ ;;; (markup-writer 'slide-topic (find-engine 'html) + :options '(:title :outline? :class :ident) :action (lambda (n e) (let ((title (markup-option n :title)) (body (markup-body n))) -- cgit v1.2.3