aboutsummaryrefslogtreecommitdiff
path: root/src/guile/skribilo/engine
diff options
context:
space:
mode:
authorLudovic Court`es2007-07-03 09:04:14 +0000
committerLudovic Court`es2007-07-03 09:04:14 +0000
commitf9392ad8b5d8af05d7f59757507c94044cc343af (patch)
tree728ea377a75932e600c734a9ed985c2c537cc3d6 /src/guile/skribilo/engine
parent3650657f3e41690a1051c2f3e14e67acaf60f6b2 (diff)
parent46122eb2392f848079320e09eda8b747dc9a4177 (diff)
downloadskribilo-f9392ad8b5d8af05d7f59757507c94044cc343af.tar.gz
skribilo-f9392ad8b5d8af05d7f59757507c94044cc343af.tar.lz
skribilo-f9392ad8b5d8af05d7f59757507c94044cc343af.zip
Merge from skribilo@sv.gnu.org--2006
Patches applied: * lcourtes@laas.fr--2005-mobile/skribilo--devel--1.2 (patch 110-117) - Merge from skribilo@sv.gnu.org--2006/skribilo--devo--1.2 - Fixed (or almost so) the C lexer. - Autoload `(skribilo coloring c)' in the default module. - `lout' engine: Fixed argument passing for `lout-illustration'. - `base' package: Honor `:line #f' in `prog'. - Tiny doc fix. - Removed global hash tables for marks and program lines. - Fixed and simplified `(ref :line ...)', aka. `line-ref'. * skribilo@sv.gnu.org--2006/skribilo--devo--1.2 (patch 122-133) - `diff' package: Small bug fix. - Updated `TODO'. - Factorized `bib-ref+', add a `:sort-bib-refs' options to `ref'. - Updated documentation of `ref'. - `lncs' package: Honor `:sort-bib-refs'. - Fixed (or almost so) the C lexer. - Autoload `(skribilo coloring c)' in the default module. - `lout' engine: Fixed argument passing for `lout-illustration'. - `base' package: Honor `:line #f' in `prog'. - Tiny doc fix. - Removed global hash tables for marks and program lines. - Fixed and simplified `(ref :line ...)', aka. `line-ref'. git-archimport-id: lcourtes@laas.fr--2006-libre/skribilo--devo--1.2--patch-83
Diffstat (limited to 'src/guile/skribilo/engine')
-rw-r--r--src/guile/skribilo/engine/base.scm7
-rw-r--r--src/guile/skribilo/engine/context.scm16
-rw-r--r--src/guile/skribilo/engine/html.scm25
-rw-r--r--src/guile/skribilo/engine/latex.scm16
-rw-r--r--src/guile/skribilo/engine/lout.scm31
5 files changed, 33 insertions, 62 deletions
diff --git a/src/guile/skribilo/engine/base.scm b/src/guile/skribilo/engine/base.scm
index 9e9445e..344146e 100644
--- a/src/guile/skribilo/engine/base.scm
+++ b/src/guile/skribilo/engine/base.scm
@@ -498,7 +498,8 @@
(markup-writer 'line-ref
:options '(:offset)
:action (lambda (n e)
- (let ((o (markup-option n :offset))
- (n (markup-ident (handle-body (markup-body n)))))
- (evaluate-document (it (if (integer? o) (+ o n) n)) e))))
+ (let ((o (markup-option n :offset))
+ (n (markup-option (handle-ast (markup-body n)) :number)))
+ (if (integer? n)
+ (display (if (integer? o) (+ o n) n))))))
diff --git a/src/guile/skribilo/engine/context.scm b/src/guile/skribilo/engine/context.scm
index 1b4301b..98069a3 100644
--- a/src/guile/skribilo/engine/context.scm
+++ b/src/guile/skribilo/engine/context.scm
@@ -1060,22 +1060,6 @@
:action (lambda (n e)
(context-url (markup-option n :url) (markup-option n :text) e)))
-;;//;*---------------------------------------------------------------------*/
-;;//;* line-ref ... */
-;;//;*---------------------------------------------------------------------*/
-;;//(markup-writer 'line-ref
-;;// :options '(:offset)
-;;// :before "{\\textit{"
-;;// :action (lambda (n e)
-;;// (let ((o (markup-option n :offset))
-;;// (v (string->number (markup-option n :text))))
-;;// (cond
-;;// ((and (number? o) (number? v))
-;;// (display (+ o v)))
-;;// (else
-;;// (display v)))))
-;;// :after "}}")
-
;;; ======================================================================
;;; &the-bibliography ...
diff --git a/src/guile/skribilo/engine/html.scm b/src/guile/skribilo/engine/html.scm
index 688d33d..a16f01f 100644
--- a/src/guile/skribilo/engine/html.scm
+++ b/src/guile/skribilo/engine/html.scm
@@ -2069,6 +2069,21 @@
(output (or v (markup-option n :url)) e)))
:after "</a>")
+
+;*---------------------------------------------------------------------*/
+;* &prog-line ... */
+;*---------------------------------------------------------------------*/
+(markup-writer '&prog-line
+ :before (lambda (n e)
+ (let ((before (writer-before
+ (markup-writer-get '&prog-line base-engine))))
+ (format #t "<a name=\"~a\""
+ (string-canonicalize (markup-ident n)))
+ (html-class n)
+ (display ">")
+ (before n e)))
+ :after "</a>\n")
+
;*---------------------------------------------------------------------*/
;* line-ref ... */
;*---------------------------------------------------------------------*/
@@ -2077,12 +2092,14 @@
:before (html-markup-class "i")
:action (lambda (n e)
(let ((o (markup-option n :offset))
- (v (string->number (markup-option n :text))))
- (if (and (number? o) (number? v))
- (markup-option-add! n :text (+ o v)))
+ (v (markup-option (handle-ast (markup-body n)) :number)))
+ (cond ((and (number? o) (number? v))
+ (markup-option-set! n :text (+ o v)))
+ ((number? v)
+ (markup-option-set! n :text v)))
(output n e (markup-writer-get 'ref e))
(if (and (number? o) (number? v))
- (markup-option-add! n :text v))))
+ (markup-option-set! n :text v))))
:after "</i>")
;*---------------------------------------------------------------------*/
diff --git a/src/guile/skribilo/engine/latex.scm b/src/guile/skribilo/engine/latex.scm
index 9b49545..8523c9a 100644
--- a/src/guile/skribilo/engine/latex.scm
+++ b/src/guile/skribilo/engine/latex.scm
@@ -1579,22 +1579,6 @@
(format #t "}{~a}" url))))))
;*---------------------------------------------------------------------*/
-;* line-ref ... */
-;*---------------------------------------------------------------------*/
-(markup-writer 'line-ref
- :options '(:offset)
- :before "{\\textit{"
- :action (lambda (n e)
- (let ((o (markup-option n :offset))
- (v (string->number (markup-option n :text))))
- (cond
- ((and (number? o) (number? v))
- (display (+ o v)))
- (else
- (display v)))))
- :after "}}")
-
-;*---------------------------------------------------------------------*/
;* &the-bibliography ... */
;*---------------------------------------------------------------------*/
(markup-writer '&the-bibliography
diff --git a/src/guile/skribilo/engine/lout.scm b/src/guile/skribilo/engine/lout.scm
index bc796bd..a93cde7 100644
--- a/src/guile/skribilo/engine/lout.scm
+++ b/src/guile/skribilo/engine/lout.scm
@@ -2472,22 +2472,6 @@
(output (transform n) e))))))
;*---------------------------------------------------------------------*/
-;* line-ref ... */
-;*---------------------------------------------------------------------*/
-(markup-writer 'line-ref
- :options '(:offset)
- :before "{ @I {" ;; FIXME: Not tested
- :action (lambda (n e)
- (let ((o (markup-option n :offset))
- (v (string->number (markup-option n :text))))
- (cond
- ((and (number? o) (number? v))
- (display (+ o v)))
- (else
- (display v)))))
- :after "} }")
-
-;*---------------------------------------------------------------------*/
;* &the-bibliography ... */
;*---------------------------------------------------------------------*/
(markup-writer '&the-bibliography
@@ -2811,13 +2795,14 @@
(gensym "lout-illustration")))
".eps"))
(port (open-output-pipe
- (apply string-append
- (or (engine-custom lout 'lout-program-name)
- "lout")
- " -o " output
- " -EPS "
- (engine-custom lout
- 'lout-program-arguments)))))
+ (string-append
+ (or (engine-custom lout 'lout-program-name)
+ "lout")
+ " -o " output
+ " -EPS "
+ (string-join
+ (engine-custom lout
+ 'lout-program-arguments))))))
;; send the illustration to Lout's standard input
(display (illustration-header) port)