summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLudovic Courtès2008-01-30 19:13:06 +0100
committerLudovic Courtès2008-01-30 19:13:06 +0100
commit468af210d5bb490a7a737d4e840eb0f53caef7a3 (patch)
tree08e1d0be019d181cfc71b03db479fcc3c1f54147 /src
parent37e65d3cfc53f0a34f7e7372629d25adf238f68f (diff)
downloadskribilo-468af210d5bb490a7a737d4e840eb0f53caef7a3.tar.gz
skribilo-468af210d5bb490a7a737d4e840eb0f53caef7a3.tar.lz
skribilo-468af210d5bb490a7a737d4e840eb0f53caef7a3.zip
web-book2: Cosmetic changes.
* src/guile/skribilo/package/web-book2.scm (%small-toc-class): New. (make-small-toc): New `e' argument. [enclose]: New. Use HTML <div>, preferably.
Diffstat (limited to 'src')
-rw-r--r--src/guile/skribilo/package/web-book2.scm24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/guile/skribilo/package/web-book2.scm b/src/guile/skribilo/package/web-book2.scm
index 978d012..8b50e99 100644
--- a/src/guile/skribilo/package/web-book2.scm
+++ b/src/guile/skribilo/package/web-book2.scm
@@ -49,26 +49,36 @@
;;; Small table-of-contents.
;;;
+(define %small-toc-class
+ "small-toc")
+
(define (section? n)
(and (container? n)
(memq (markup-markup n)
'(chapter section subsection subsubsection))))
-(define (make-small-toc n)
+(define (make-small-toc n e)
;; Return a small table of contents, for use at the beginning of chapter N.
+ (define enclose
+ (if (engine-format? "html" e)
+ (lambda (toc)
+ (! (format #f "\n<div class=\"~a\">\n$1\n</div>" %small-toc-class)
+ toc))
+ (lambda (toc)
+ (p :class %small-toc-class toc))))
+
(define (make-uplink)
(let ((parent (ast-parent n)))
(and parent
(ref :handle (handle parent)
- :text (list "<< up to ``"
- (markup-option parent :title)
- "''")))))
+ :text (list (symbol "uparrow") " "
+ (markup-option parent :title))))))
(let ((kids (filter section? (markup-body n))))
- (p :class "small-toc"
+ (enclose
(list
(and (not (null? kids))
- (list "Table of Contents"
+ (list "Contents"
(itemize
(map (lambda (section)
(item (ref :handle (handle section)
@@ -105,7 +115,7 @@
(cons (resolve (lambda (n e env)
(let ((p (ast-parent n)))
(and (in-file-of-its-own? p e)
- (make-small-toc p)))))
+ (make-small-toc p e)))))
(the-body args))))
(apply real-markup args)))))