aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès2008-01-28 17:05:31 +0100
committerLudovic Courtès2008-01-28 17:05:31 +0100
commitb8719625b1e2e6fff136c48579d75ebd5a185dab (patch)
tree1156511cca0adad3f3eb27fafbe0b5aaaa9672b8
parentf9f7ba3ff0419483531f0e1d97b58aabcfc60bc0 (diff)
downloadskribilo-b8719625b1e2e6fff136c48579d75ebd5a185dab.tar.gz
skribilo-b8719625b1e2e6fff136c48579d75ebd5a185dab.tar.lz
skribilo-b8719625b1e2e6fff136c48579d75ebd5a185dab.zip
lout: Fix `ref' and `:page'.
* src/guile/skribilo/engine/lout.scm (ref): Honor `show-page-num?' for marks; get IDENT from TARGET rather than from the `text' markup option (which doesn't exist).
-rw-r--r--src/guile/skribilo/engine/lout.scm58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/guile/skribilo/engine/lout.scm b/src/guile/skribilo/engine/lout.scm
index ed4c1b8..1f91ad4 100644
--- a/src/guile/skribilo/engine/lout.scm
+++ b/src/guile/skribilo/engine/lout.scm
@@ -2517,36 +2517,36 @@
:figure :mark :handle :ident)
:action (lambda (n e)
- (let ((ident (markup-option n 'text))
- (kind (markup-option n 'kind))
+ ;; A handle to the target is passed as the body of each `ref'
+ ;; instance (see `package/base.scm').
+ (let ((kind (markup-option n 'kind))
(text (markup-option n :text))
- (show-page-num? (markup-option n :page)))
-
- ;; A handle to the target is passed as the body of each `ref'
- ;; instance (see `package/base.scm').
- (let ((target (handle-ast (markup-body n))))
- (lout-debug "ref: target=~a ident=~a" target ident)
- (if text (output text e))
-
- ;; Marks don't have a number
- (if (and ident (eq? kind 'mark))
- (format #t (lout-page-of ident))
- (begin
- ;; Don't output a section/whatever number
- ;; when text is provided in order to be
- ;; consistent with the HTML back-end.
- ;; Sometimes (eg. for user-defined markups),
- ;; we don't even know how to reference them
- ;; anyway.
- (if (not text)
- (let ((number
- (if (eq? kind 'figure)
- (markup-option target :number)
- (markup-number-string target))))
- (display " ")
- (display number))
- (if (and ident show-page-num?)
- (format #t (lout-page-of ident))))))))))
+ (show-page-num? (markup-option n :page))
+ (target (handle-ast (markup-body n))))
+
+ (let ((ident (markup-ident target)))
+ (lout-debug "ref: target=~a ident=~a" target ident)
+
+ (if text (output text e))
+
+ (if (and (eq? kind 'mark) ident show-page-num?)
+
+ ;; Marks don't have a number.
+ (format #t (lout-page-of ident))
+
+ ;; Don't output a section/whatever number when text is
+ ;; provided in order to be consistent with the HTML
+ ;; back-end. Sometimes (e.g., for user-defined
+ ;; markups), we don't even know how to reference them
+ ;; anyway.
+ (if (not text)
+ (let ((number (if (eq? kind 'figure)
+ (markup-option target :number)
+ (markup-number-string target))))
+ (display " ")
+ (display number))
+ (if (and ident show-page-num?)
+ (format #t (lout-page-of ident)))))))))
;*---------------------------------------------------------------------*/
;* lout-make-url-breakable ... */