summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès2008-01-20 00:15:54 +0100
committerLudovic Courtès2008-01-20 00:15:54 +0100
commit390afd31ccb548a2c2cb87906bdb6026fc64fa3e (patch)
treee636e49541fe0e4df4c0504dc3ea6e6408f24cd7
parentc8215f1e6075a6472574456318c627f7a04765e8 (diff)
downloadskribilo-390afd31ccb548a2c2cb87906bdb6026fc64fa3e.tar.gz
skribilo-390afd31ccb548a2c2cb87906bdb6026fc64fa3e.tar.lz
skribilo-390afd31ccb548a2c2cb87906bdb6026fc64fa3e.zip
html: Fix xrefs to the `document' node.
* src/guile/skribilo/engine/html.scm (html-file-default): Don't use `tmpnam', was stupid. (document): Record the current `*destination-file*' as `:file' option of N. (&html-generic-document): Parameterize `*destination-file*'.
-rw-r--r--src/guile/skribilo/engine/html.scm25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/guile/skribilo/engine/html.scm b/src/guile/skribilo/engine/html.scm
index 7858e1a..d910fee 100644
--- a/src/guile/skribilo/engine/html.scm
+++ b/src/guile/skribilo/engine/html.scm
@@ -1,6 +1,6 @@
;;; html.scm -- HTML engine.
;;;
-;;; Copyright 2005, 2006, 2007 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright 2005, 2006, 2007, 2008 Ludovic Courtès <ludo@gnu.org>
;;; Copyright 2003, 2004 Manuel Serrano
;;;
;;;
@@ -38,9 +38,11 @@
:autoload (skribilo sui) (document-sui)
:autoload (ice-9 rdelim) (read-line)
:autoload (ice-9 regex) (regexp-substitute/global)
+
:use-module (srfi srfi-13)
:use-module (srfi srfi-14)
:use-module ((srfi srfi-19) :renamer (symbol-prefix-proc 's19:))
+ :use-module (srfi srfi-39)
:export (html-engine html-title-engine html-file
html-width html-class html-markup-class
@@ -62,7 +64,7 @@
(define html-file-default
;; Default implementation of the `file-name-proc' custom.
(let ((table '())
- (filename (tmpnam)))
+ (filename (gensym "filename")))
(define (get-file-name base suf)
(let* ((c (assoc base table))
(n (if (pair? c)
@@ -584,6 +586,7 @@
;*---------------------------------------------------------------------*/
(markup-writer 'document
:options '(:title :author :ending :html-title :env :keywords)
+
:action (lambda (n e)
(let* ((id (markup-ident n))
(title (new markup
@@ -593,7 +596,12 @@
(class (markup-class n))
(options `((author ,(markup-option n :author))))
(body (markup-option n :title)))))
+
+ ;; Record the file name, for use by `html-file-default'.
+ (markup-option-add! n :file (*destination-file*))
+
(&html-generic-document n title e)))
+
:after (lambda (n e)
(if (engine-custom e 'emit-sui)
(document-sui n e))))
@@ -1196,9 +1204,10 @@
;; directly opened by Skribe
(if (document? n)
(output html e)
- (with-output-to-file (html-file n e)
- (lambda ()
- (output html e))))))
+ (parameterize ((*destination-file* (html-file n e)))
+ (with-output-to-file (*destination-file*)
+ (lambda ()
+ (output html e)))))))
;*---------------------------------------------------------------------*/
;* &html-generic-subdocument ... */
@@ -2259,3 +2268,9 @@
;* Restore the base engine */
;*---------------------------------------------------------------------*/
(default-engine-set! (find-engine 'base))
+
+
+;;; Local Variables:
+;;; mode: scheme
+;;; coding: latin-1
+;;; End: