summaryrefslogtreecommitdiff
path: root/src/guile/skribilo/engine/info.scm
diff options
context:
space:
mode:
authorLudovic Courtès2008-11-25 00:03:26 +0100
committerLudovic Courtès2008-11-25 00:03:26 +0100
commitcb4646af4641474d195f7481a735769ae04fb600 (patch)
treeadda748aa0edbe8d88dd641e0aae1c7fbe50de99 /src/guile/skribilo/engine/info.scm
parente5101032f7442c2def430141b0e2db1efc8d017d (diff)
downloadskribilo-cb4646af4641474d195f7481a735769ae04fb600.tar.gz
skribilo-cb4646af4641474d195f7481a735769ae04fb600.tar.lz
skribilo-cb4646af4641474d195f7481a735769ae04fb600.zip
info: Add supported options for each markup writer.
Diffstat (limited to 'src/guile/skribilo/engine/info.scm')
-rw-r--r--src/guile/skribilo/engine/info.scm28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/guile/skribilo/engine/info.scm b/src/guile/skribilo/engine/info.scm
index acbbd5d..19168f2 100644
--- a/src/guile/skribilo/engine/info.scm
+++ b/src/guile/skribilo/engine/info.scm
@@ -97,7 +97,7 @@
(let ((top (if (document? parent)
"Top"
(block-title parent e))))
- (let loop ((els (markup-body parent))
+ (let loop ((els (filter %block? (markup-body parent)))
(prev #f))
(cond
((null? els)
@@ -383,6 +383,10 @@
;* info ::%reference ... */
;*---------------------------------------------------------------------*/
(markup-writer 'ref info-engine
+ :options '(:text :page text kind
+ :chapter :section :subsection :subsubsection
+ :figure :mark :handle :ident)
+
:action (lambda (n e)
(let ((target (handle-ast (markup-body n))))
(case (markup-markup target)
@@ -493,6 +497,7 @@
;* info ::%list ... */
;*---------------------------------------------------------------------*/
(markup-writer 'itemize info-engine
+ :options '(:symbol)
:action (lambda (n e)
(for-each (lambda (item)
(with-justification (make-justifier
@@ -505,6 +510,7 @@
(markup-body n))))
(markup-writer 'enumerate info-engine
+ :options '(:symbol)
:action (lambda (n e)
(let loop ((num 1)
(items (markup-body n)))
@@ -521,13 +527,15 @@
(loop (+ num 1) (cdr items)))))))
(markup-writer 'description info-engine
+ :options '(:symbol)
:action (lambda (n e)
(for-each (lambda (item)
(with-justification
(make-justifier
(- (justification-width) 3)
'left)
- (output item e)
+ (lambda ()
+ (output item e))
3))
(markup-body n))))
@@ -633,7 +641,9 @@
;* info ::%table ... */
;*---------------------------------------------------------------------*/
(markup-writer 'table info-engine
- :options '(:border)
+ :options '(:border :width
+ ;; FIXME: We don't actually support the following.
+ :frame :rules :cellpadding :rulecolor)
:action (lambda (n e)
(let ((border (markup-option n :border)))
(output-flush *margin*)
@@ -644,6 +654,13 @@
(output-flush *margin*))))
;*---------------------------------------------------------------------*/
+;* info ::&the-bibliography ... */
+;*---------------------------------------------------------------------*/
+(markup-writer '&the-bibliography info-engine
+ :action (lambda (n e)
+ (output-justified "[FIXME: Bibliography not implemented yet.]")))
+
+;*---------------------------------------------------------------------*/
;* border-table->info ... */
;*---------------------------------------------------------------------*/
(define (border-table->info table)
@@ -654,7 +671,7 @@
;* info ::%figure ... */
;*---------------------------------------------------------------------*/
(markup-writer 'figure info-engine
- :options '(:legend :number)
+ :options '(:legend :number :multicolumns)
:action (lambda (n e)
(let ((body (markup-body n))
(legend (markup-option n :legend))
@@ -664,7 +681,8 @@
(output-newline)
(output-newline)
(output-justified "Fig. ")
- (output-justified (number->string number))
+ (and (number? number)
+ (output-justified (number->string number)))
(output-justified ": ")
(output legend e)
(output-newline))))