summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog35
-rw-r--r--NEWS8
-rw-r--r--src/guile/skribilo/engine/html.scm8
-rw-r--r--src/guile/skribilo/engine/latex.scm6
-rw-r--r--src/guile/skribilo/engine/lout.scm4
-rw-r--r--src/guile/skribilo/evaluator.scm8
-rw-r--r--src/guile/skribilo/reader/skribe.scm56
-rw-r--r--src/guile/skribilo/skribe/api.scm16
8 files changed, 104 insertions, 37 deletions
diff --git a/ChangeLog b/ChangeLog
index 6d86a2e..e168292 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,41 @@
# arch-tag: automatic-ChangeLog--lcourtes@laas.fr--2005-mobile/skribilo--devel--1.2
#
+2005-12-04 21:20:44 GMT Ludovic Courtes <ludovic.courtes@laas.fr> patch-16
+
+ Summary:
+ Added the `~' markup. Added SRFI-62 and SRFI-30 support to the Skribe reader.
+ Revision:
+ skribilo--devel--1.2--patch-16
+
+ * NEWS: Added actual news.
+
+ * src/guile/skribilo/skribe/api.scm (~): New markup.
+
+ * src/guile/skribilo/engine/html.scm: Added a writer for `~'.
+
+ * src/guile/skribilo/engine/latex.scm: Likewise.
+
+ * src/guile/skribilo/engine/lout.scm: Likewise.
+
+ * src/guile/skribilo/evaluator.scm (skribe-include): Added a `:reader'
+ argument.
+
+ * src/guile/skribilo/reader/skribe.scm (*skribe-reader*): Renamed to
+ `%skribe-reader'.
+ (%make-skribe-reader): Moved the sharp reader code to...
+ (&sharp-reader): ... here. Added support for SRFI-62 and SRFI-30
+ (Bigloo supports both).
+
+ modified files:
+ ChangeLog NEWS src/guile/skribilo/engine/html.scm
+ src/guile/skribilo/engine/latex.scm
+ src/guile/skribilo/engine/lout.scm
+ src/guile/skribilo/evaluator.scm
+ src/guile/skribilo/reader/skribe.scm
+ src/guile/skribilo/skribe/api.scm
+
+
2005-12-03 16:44:38 GMT Ludovic Courtes <ludovic.courtes@laas.fr> patch-15
Summary:
diff --git a/NEWS b/NEWS
index a8e220f..7257a87 100644
--- a/NEWS
+++ b/NEWS
@@ -1 +1,7 @@
-No news today.
+New in Skribilo 1.2 (compared to Skribe 1.2d)
+
+ * New engine: Lout (see http://lout.sf.net/).
+
+ * New markups: `~', `numref', `!lout', `lout-illustration'.
+
+ * Extended markups: `footnote' now takes a `:label' option.
diff --git a/src/guile/skribilo/engine/html.scm b/src/guile/skribilo/engine/html.scm
index 01708c8..b5c7a55 100644
--- a/src/guile/skribilo/engine/html.scm
+++ b/src/guile/skribilo/engine/html.scm
@@ -1411,6 +1411,14 @@
:after "</p>")
;*---------------------------------------------------------------------*/
+;* ~ ... */
+;*---------------------------------------------------------------------*/
+(markup-writer '~
+ :before "&nbsp;"
+ :after #f
+ :action #f)
+
+;*---------------------------------------------------------------------*/
;* footnote ... */
;*---------------------------------------------------------------------*/
(markup-writer 'footnote
diff --git a/src/guile/skribilo/engine/latex.scm b/src/guile/skribilo/engine/latex.scm
index 2a59b4f..90e32cf 100644
--- a/src/guile/skribilo/engine/latex.scm
+++ b/src/guile/skribilo/engine/latex.scm
@@ -478,9 +478,9 @@
colors))
;*---------------------------------------------------------------------*/
-;* &~ ... */
+;* ~ ... */
;*---------------------------------------------------------------------*/
-(markup-writer '&~
+(markup-writer '~
:before "~"
:action #f)
@@ -1468,7 +1468,7 @@
(if t
(begin
(output t e)
- (output "~" e (markup-writer-get '&~ e))))))
+ (output "~" e (markup-writer-get '~ e))))))
:after (lambda (n e)
(let* ((c (handle-ast (markup-body n)))
(id (markup-ident c)))
diff --git a/src/guile/skribilo/engine/lout.scm b/src/guile/skribilo/engine/lout.scm
index 6d3dbfa..1ae5cd0 100644
--- a/src/guile/skribilo/engine/lout.scm
+++ b/src/guile/skribilo/engine/lout.scm
@@ -941,9 +941,9 @@
(list r g b)))))))
;*---------------------------------------------------------------------*/
-;* &~ ... */
+;* ~ ... */
;*---------------------------------------------------------------------*/
-(markup-writer '&~ :before "~" :action #f)
+(markup-writer '~ :before "~" :action #f)
(define (lout-page-orientation orientation)
;; Return a string representing the Lout page orientation name for symbol
diff --git a/src/guile/skribilo/evaluator.scm b/src/guile/skribilo/evaluator.scm
index e4ef208..5af52aa 100644
--- a/src/guile/skribilo/evaluator.scm
+++ b/src/guile/skribilo/evaluator.scm
@@ -158,7 +158,9 @@
;;;
;;; SKRIBE-INCLUDE
;;;
-(define* (skribe-include file :optional (path (*document-path*)))
+(define* (skribe-include file :key (path (*document-path*))
+ (reader %default-reader))
+ ;; FIXME: We should default to `*skribilo-current-reader*'.
(unless (every string? path)
(skribe-error 'skribe-include "illegal path" path))
@@ -172,11 +174,11 @@
(with-input-from-file path
(lambda ()
- (let Loop ((exp (%default-reader (current-input-port)))
+ (let Loop ((exp (reader (current-input-port)))
(res '()))
(if (eof-object? exp)
(if (and (pair? res) (null? (cdr res)))
(car res)
(reverse! res))
- (Loop (%default-reader (current-input-port))
+ (Loop (reader (current-input-port))
(cons (%evaluate exp) res))))))))
diff --git a/src/guile/skribilo/reader/skribe.scm b/src/guile/skribilo/reader/skribe.scm
index 5c71cc1..410ef01 100644
--- a/src/guile/skribilo/reader/skribe.scm
+++ b/src/guile/skribilo/reader/skribe.scm
@@ -44,37 +44,39 @@
the Skribe syntax."
(if (string> version "1.2d")
(error "make-skribe-reader: unsupported version" version)
- *skribe-reader*))
+ %skribe-reader))
-
-(define (%make-skribe-reader)
+(define &sharp-reader
+ ;; The reader for what comes after a `#' character.
(let* ((dsssl-keyword-reader ;; keywords à la `#!key'
(r:make-token-reader #\!
- (r:token-reader-procedure
- (r:standard-token-reader 'keyword))))
- (sharp-reader (r:make-reader (cons dsssl-keyword-reader
- (map r:standard-token-reader
- '(character srfi-4
- vector
- number+radix
- boolean)))
- #f ;; use default fault handler
- 'reader/record-positions))
- (colon-keywords ;; keywords à la `:key' fashion
- (r:make-token-reader #\:
(r:token-reader-procedure
- (r:standard-token-reader 'keyword))))
- (square-bracket-free-symbol-misc-chars
- (let* ((tr (r:standard-token-reader 'guile-symbol-misc-chars))
- (tr-spec (r:token-reader-specification tr))
- (tr-proc (r:token-reader-procedure tr)))
- (r:make-token-reader (filter (lambda (chr)
- (not (or (eq? chr #\[)
- (eq? chr #\]))))
- tr-spec)
- tr-proc))))
+ (r:standard-token-reader 'keyword)))))
+ (r:make-reader (cons dsssl-keyword-reader
+ (map r:standard-token-reader
+ '(character srfi-4 vector
+ number+radix boolean
+ srfi30-block-comment
+ srfi62-sexp-comment)))
+ #f ;; use default fault handler
+ 'reader/record-positions)))
+
+(define (%make-skribe-reader)
+ (let ((colon-keywords ;; keywords à la `:key' fashion
+ (r:make-token-reader #\:
+ (r:token-reader-procedure
+ (r:standard-token-reader 'keyword))))
+ (square-bracket-free-symbol-misc-chars
+ (let* ((tr (r:standard-token-reader 'guile-symbol-misc-chars))
+ (tr-spec (r:token-reader-specification tr))
+ (tr-proc (r:token-reader-procedure tr)))
+ (r:make-token-reader (filter (lambda (chr)
+ (not (or (eq? chr #\[)
+ (eq? chr #\]))))
+ tr-spec)
+ tr-proc))))
- (r:make-reader (cons* (r:make-token-reader #\# sharp-reader)
+ (r:make-reader (cons* (r:make-token-reader #\# &sharp-reader)
colon-keywords
square-bracket-free-symbol-misc-chars
(map r:standard-token-reader
@@ -90,7 +92,7 @@ the Skribe syntax."
)))
;; We actually cache an instance here.
-(define *skribe-reader* (%make-skribe-reader))
+(define %skribe-reader (%make-skribe-reader))
diff --git a/src/guile/skribilo/skribe/api.scm b/src/guile/skribilo/skribe/api.scm
index 34528ac..a300606 100644
--- a/src/guile/skribilo/skribe/api.scm
+++ b/src/guile/skribilo/skribe/api.scm
@@ -255,6 +255,19 @@
;*---------------------------------------------------------------------*/
(define-simple-markup paragraph)
+
+;*---------------------------------------------------------------------*/
+;* ~ (unbreakable space) ... */
+;*---------------------------------------------------------------------*/
+(define-markup (~ #!rest opts #!key (class #f))
+ (new markup
+ (markup '~)
+ (ident (gensym '~))
+ (class class)
+ (required-options '())
+ (options (the-options opts :class))
+ (body (the-body opts))))
+
;*---------------------------------------------------------------------*/
;* footnote ... */
;*---------------------------------------------------------------------*/
@@ -1062,7 +1075,8 @@
(o (markup-option s 'used)))
(markup-option-add! s 'used (if (pair? o) (cons h o) (list h)))
n)
- (unref #f v 'bib))))
+ (unref #f v 'bib)))) ; FIXME: This prevents source location
+ ; info to be provided in the warning msg
(define (bib-ref text)
(if (pair? text)
(new markup