From 243aa4a26a7c087f4216eb3b537f355bc31a6d19 Mon Sep 17 00:00:00 2001
From: Ludovic Court`es
Date: Mon, 23 Oct 2006 17:25:00 +0000
Subject: Added a `:arguments' keyword to `slide-embed'.

* src/guile/skribilo/package/slide.scm (slide-embed): Added an
  `arguments' keyword.

* doc/user/slide.skb: Updated the markup documentation.

git-archimport-id: skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-7
---
 src/guile/skribilo/package/slide.scm | 1 +
 1 file changed, 1 insertion(+)

(limited to 'src')

diff --git a/src/guile/skribilo/package/slide.scm b/src/guile/skribilo/package/slide.scm
index 7f731e3..c0a8473 100644
--- a/src/guile/skribilo/package/slide.scm
+++ b/src/guile/skribilo/package/slide.scm
@@ -146,6 +146,7 @@
 (define-markup (slide-embed #!rest opt
 			    #!key
 			    command
+                            (arguments '())
 			    (geometry-opt "-geometry")
 			    (geometry #f) (rgeometry #f)
 			    (transient #f) (transient-opt #f)
-- 
cgit v1.2.3


From 867c18c525470e0a298c2b839f578016be17257b Mon Sep 17 00:00:00 2001
From: Ludovic Court`es
Date: Mon, 23 Oct 2006 17:25:54 +0000
Subject: Lout engine: Implemented `slide-embed'.

* src/guile/skribilo/engine/lout.scm (lout-definitions): Renamed
  `@SkribeMark' to `@SkribiloMark'.  Added `@SkribiloEmbed'.

* src/guile/skribilo/package/slide/lout.scm: No longer use
  `define-skribe-module'.
  (slide-embed): Use `@SkribiloEmbed' (works fine).

git-archimport-id: skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-8
---
 src/guile/skribilo/engine/lout.scm        | 32 ++++++++++++++++---
 src/guile/skribilo/package/slide/lout.scm | 53 ++++++++++++++++++-------------
 2 files changed, 58 insertions(+), 27 deletions(-)

(limited to 'src')

diff --git a/src/guile/skribilo/engine/lout.scm b/src/guile/skribilo/engine/lout.scm
index 82e98d7..d40f36a 100644
--- a/src/guile/skribilo/engine/lout.scm
+++ b/src/guile/skribilo/engine/lout.scm
@@ -378,9 +378,9 @@
   (let ((leader (engine-custom engine 'toc-leader))
 	(leader-space (engine-custom engine 'toc-leader-space)))
     (apply string-append
-	   `("# @SkribeMark implements Skribe's marks "
+	   `("# @SkribiloMark implements Skribe's marks "
 	     "(i.e. cross-references)\n"
-	     "def @SkribeMark\n"
+	     "def @SkribiloMark\n"
 	     "    right @Tag\n"
 	     "{\n"
 	     "    @PageMark @Tag\n"
@@ -389,7 +389,29 @@
 	     "# @SkribiloLeaders is used in `toc'\n"
 	     "# (this is mostly copied from the expert's guide)\n"
 	     "def @SkribiloLeaders { "
-	     ,leader " |" ,leader-space " @SkribiloLeaders }\n\n"))))
+	     ,leader " |" ,leader-space " @SkribiloLeaders }\n\n"
+
+             "# Embedding an application in PDF (``Launch'' actions)\n"
+             "# (tested with XPdf 3.1 and Evince 0.4.0)\n"
+             "def @SkribiloEmbed\n"
+             "  left command\n"
+             "  import @PSLengths\n"
+             "    named borderwidth { 1p }\n"
+             "  right body\n"
+             "{\n"
+             "  {\n"
+             "    \"[ /Rect [0 0 xsize ysize]\"\n"
+             "    \"  /Color [0 0 1]\"\n"
+             "    \"  /Border [ 0 0 \" borderwidth \" ]\"\n"
+             "    \"  /Action /Launch\"\n"
+             "    \"  /File  (\" command \")\"\n"
+             "    \"  /Subtype /Link\"\n"
+             "    \"/ANN\"\n"
+             "    \"pdfmark\"\n"
+             "  }\n"
+             "  @Graphic body\n"
+             "}\n\n"))))
+
 
 (define (lout-make-doc-cover-sheet doc engine)
   ;; Create a cover sheet for node `doc' which is a doc-style Lout document.
@@ -1319,7 +1341,7 @@
 	   ;; Lout markup)
 	   (display "\n//1.8vx\n@B { ")
 	   (output title e)
-	   (display " }\n@SkribeMark { ")
+	   (display " }\n@SkribiloMark { ")
 	   (display (lout-tagify ident))
 	   (display " }\n//0.8vx\n\n"))
 	(begin
@@ -2382,7 +2404,7 @@
    :action (lambda (n e)
 	     (if (markup-ident n)
 		 (begin
-		   (display "{ @SkribeMark { ")
+		   (display "{ @SkribiloMark { ")
 		   (display (lout-tagify (markup-ident n)))
 		   (display " } }"))
 		 (skribe-error 'lout "mark: Node has no identifier" n))))
diff --git a/src/guile/skribilo/package/slide/lout.scm b/src/guile/skribilo/package/slide/lout.scm
index d53cff1..f3c9a61 100644
--- a/src/guile/skribilo/package/slide/lout.scm
+++ b/src/guile/skribilo/package/slide/lout.scm
@@ -18,9 +18,17 @@
 ;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 ;;; USA.
 
-(define-skribe-module (skribilo package slide lout)
+(define-module (skribilo package slide lout)
   :use-module (skribilo utils syntax)
 
+  :autoload   (skribilo utils strings) (make-string-replace)
+  :use-module (skribilo engine)
+  :use-module (skribilo writer)
+  :autoload   (skribilo output)        (output)
+  :use-module (skribilo ast)
+
+  :use-module (srfi srfi-13) ;; `string-join'
+
   ;; XXX: If changing the following `autoload' to `use-module' doesn't work,
   ;; then you need to fix your Guile.  See this thread about
   ;; `make-autoload-interface':
@@ -34,6 +42,7 @@
 
 (fluid-set! current-reader %skribilo-module-reader)
 
+
 ;;; TODO:
 ;;;
 ;;; Make some more PS/PDF trickery.
@@ -83,7 +92,7 @@
 		  (and (pair? (markup-body n))
 		       (number? (car (markup-body n)))))
      :action (lambda (n e)
-		(printf "\n//~a~a # slide-vspace\n"
+		(format #t "\n//~a~a # slide-vspace\n"
 			(car (markup-body n))
 			(case (markup-option n :unit)
 			   ((cm)              "c")
@@ -94,6 +103,25 @@
 					  "Unknown vspace unit"
 					  (markup-option n :unit)))))))
 
+  (markup-writer 'slide-embed le
+     :options '(:command :arguments :alt :geometry :geometry-opt)
+     :action (lambda (n e)
+	       (let ((command       (markup-option n :command))
+                     (args          (markup-option n :arguments))
+                     (alt           (markup-option n :alt))
+                     (geometry      (markup-option n :geometry))
+                     (geometry-opt  (markup-option n :geometry-opt))
+		     (filter (make-string-replace lout-verbatim-encoding)))
+                 (format #t "~%\"~a\" @SkribiloEmbed { "
+                         (string-append command " "
+                                        (if (and geometry-opt geometry)
+                                            (string-append geometry-opt " "
+                                                           geometry " ")
+                                            "")
+                                        (string-join args " ")))
+                 (output alt e)
+                 (format #t " }\n"))))
+
   (markup-writer 'slide-pause le
      ;; FIXME:  Use a `pdfmark' custom action and a PDF transition action.
      ;; << /Type /Action
@@ -109,26 +137,7 @@
 
   ;; For movies, see
   ;; http://www.tug.org/tex-archive/macros/latex/contrib/movie15/movie15.sty .
-  (markup-writer 'slide-embed le
-     :options '(:alt :geometry :rgeometry :geometry-opt :command)
-     ;; FIXME:  `pdfmark'.
-     ;; << /Type /Action   /S /Launch
-     :action (lambda (n e)
-	       (let ((command (markup-option n :command))
-		     (filter (make-string-replace lout-verbatim-encoding))
-		     (pdfmark "[ /Rect [ 0 ysize xsize 0 ]
-/Name /Comment
-/Contents (This is an embedded application)
-/ANN pdfmark
-
-[ /Type /Action
-/S    /Launch
-/F    (~a)
-/OBJ pdfmark"))
-	       (display (string-append
-			 "4c @Wide 3c @High "
-			 (lout-embedded-postscript-code
-			  (filter (format #f pdfmark command)))))))))
+  )
 
 
 
-- 
cgit v1.2.3


From 3fb6f9a17400d8365519e05a79f09c6c1322eedd Mon Sep 17 00:00:00 2001
From: Ludovic Court`es
Date: Wed, 25 Oct 2006 15:04:26 +0000
Subject: Lout engine: Added a `lout-program-arguments' custom.

* src/guile/skribilo/engine/lout.scm
  (lout-engine)[lout-program-arguments]: New custom.
  (lout-illustration): Honor it.

git-archimport-id: skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-9
---
 src/guile/skribilo/engine/lout.scm | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

(limited to 'src')

diff --git a/src/guile/skribilo/engine/lout.scm b/src/guile/skribilo/engine/lout.scm
index d40f36a..9b25f30 100644
--- a/src/guile/skribilo/engine/lout.scm
+++ b/src/guile/skribilo/engine/lout.scm
@@ -657,6 +657,10 @@
 			 ;; `lout-illustration' on other back-ends.
 			 (lout-program-name "lout")
 
+                         ;; Additional arguments that should be passed to
+                         ;; Lout, e.g., `("-I foo" "-I bar")'.
+                         (lout-program-arguments '())
+
 			 ;; Title and author information in the PDF
 			 ;; document information.  If `#t', the
 			 ;; document's `:title' and `:author' are used.
@@ -2872,11 +2876,13 @@
 					     (gensym 'lout-illustration)))
 					".eps"))
 		 (port (open-output-pipe
-			(string-append (or (engine-custom lout
-							  'lout-program-name)
-					   "lout")
-				       " -o " output
-				       " -EPS"))))
+			(apply string-append
+                               (or (engine-custom lout 'lout-program-name)
+                                   "lout")
+                               " -o " output
+                               " -EPS "
+                               (engine-custom lout
+                                              'lout-program-arguments)))))
 
 	    ;; send the illustration to Lout's standard input
 	    (display (illustration-header) port)
-- 
cgit v1.2.3


From 6a06d0449967e85c3aa806736e1a27c9db99db71 Mon Sep 17 00:00:00 2001
From: Ludovic Court`es
Date: Wed, 25 Oct 2006 15:04:52 +0000
Subject: slide: Improved HTML output, especially wrt. the use of CSS.

* src/guile/skribilo/package/slide.scm (slide-topic): Pass CLASS as the
  `class' slot rather than as an option.
  (slide-subtopic): Likewise.

* src/guile/skribilo/package/slide/base.scm (make-outline-slide): Use
  `(markup-class topic)' instead of `(markup-option topic :class)'.

* src/guile/skribilo/package/slide/html.scm: Use a native Guile module.
  Use `format' instead of `printf'.
  (%slide-html-initialize): Simply issue `div' tags when a class is
  specified.

git-archimport-id: skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-10
---
 src/guile/skribilo/package/slide.scm      |  10 ++-
 src/guile/skribilo/package/slide/base.scm |   2 +-
 src/guile/skribilo/package/slide/html.scm | 123 +++++++++++++++++++++---------
 3 files changed, 96 insertions(+), 39 deletions(-)

(limited to 'src')

diff --git a/src/guile/skribilo/package/slide.scm b/src/guile/skribilo/package/slide.scm
index c0a8473..898f105 100644
--- a/src/guile/skribilo/package/slide.scm
+++ b/src/guile/skribilo/package/slide.scm
@@ -228,13 +228,14 @@
 ;*---------------------------------------------------------------------*/
 (define-markup (slide-topic #!rest opt
 			    #!key title (outline? #t)
-                            (ident #f) (class "slide-topic"))
+                            (ident #f) (class #f))
    (new container
       (markup 'slide-topic)
       (required-options '(:title :outline?))
       (ident (or ident (symbol->string (gensym 'slide-topic))))
+      (class class)
       (options `((:outline? ,outline?)
-                 ,@(the-options opt :outline?)))
+                 ,@(the-options opt :outline? :class)))
       (body (the-body opt))))
 
 ;*---------------------------------------------------------------------*/
@@ -242,13 +243,14 @@
 ;*---------------------------------------------------------------------*/
 (define-markup (slide-subtopic #!rest opt
 			       #!key title (outline? #f)
-                               (ident #f) (class "slide-subtopic"))
+                               (ident #f) (class #f))
    (new container
       (markup 'slide-subtopic)
       (required-options '(:title :outline?))
       (ident (or ident (symbol->string (gensym 'slide-subtopic))))
+      (class class)
       (options `((:outline? ,outline?)
-                 ,@(the-options opt :outline?)))
+                 ,@(the-options opt :outline? :class)))
       (body (the-body opt))))
 
 
diff --git a/src/guile/skribilo/package/slide/base.scm b/src/guile/skribilo/package/slide/base.scm
index c8e652c..1eeb25f 100644
--- a/src/guile/skribilo/package/slide/base.scm
+++ b/src/guile/skribilo/package/slide/base.scm
@@ -155,7 +155,7 @@
                                       (is-markup? n 'slide-topic))
                                     topic))))
     (output (slide :title %slide-outline-title :toc #f
-                   :class (markup-option topic :class)
+                   :class (markup-class topic)
                    ;; The mark below is needed for cross-referencing by PDF
                    ;; bookmarks.
                    (if (markup-ident topic) (mark (markup-ident topic)) "")
diff --git a/src/guile/skribilo/package/slide/html.scm b/src/guile/skribilo/package/slide/html.scm
index d47ef82..8fcbfed 100644
--- a/src/guile/skribilo/package/slide/html.scm
+++ b/src/guile/skribilo/package/slide/html.scm
@@ -18,43 +18,77 @@
 ;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 ;;; USA.
 
-(define-skribe-module (skribilo package slide html)
-  :use-module (skribilo package slide))
+(define-module (skribilo package slide html)
+  :use-module (skribilo utils syntax)
 
+  :use-module (skribilo ast)
+  :use-module (skribilo engine)
+  :use-module (skribilo writer)
+  :autoload   (skribilo resolve)     (resolve!)
+  :autoload   (skribilo output)      (output)
+  :autoload   (skribilo evaluator)   (evaluate-document)
+  :autoload   (skribilo engine html) (html-width html-title-authors)
 
+  :use-module (skribilo package slide)
+  :use-module ((skribilo package base) :select (ref))) 
+
+
+(fluid-set! current-reader %skribilo-module-reader)
+
+
+
 (define-public (%slide-html-initialize!)
   (let ((he (find-engine 'html)))
-    (skribe-message "HTML slides setup...\n")
+    (display "HTML slides setup...\n" (current-error-port))
+
     ;; &html-page-title
     (markup-writer '&html-document-title he
        ;;:predicate (lambda (n e) %slide-initialized)
        :action html-slide-title)
+
     ;; slide
     (markup-writer 'slide he
        :options '(:title :number :transition :toc :bg)
        :before (lambda (n e)
-		  (printf "<a name=\"~a\">" (markup-ident n))
+		  (format #t "<a name=\"~a\">" (markup-ident n))
 		  (display "<br>\n"))
        :action (lambda (n e)
 		  (let ((nb (markup-option n :number))
-			(t (markup-option n :title)))
-		     (skribe-eval
-		      (center
-			 (color :width (slide-body-width e)
-			    :bg (or (markup-option n :bg) "#ffffff")
-			    (table :width 100.
-			       (tr (th :align 'left
-				      (list
-				       (if nb
-					   (format #f "~a / ~a -- " nb
-						   (slide-number)))
-				       t)))
-			       (tr (td (hrule)))
-			       (tr (td :width 100. :align 'left
-				      (markup-body n))))
-			    (linebreak)))
-		      e)))
+			(t (markup-option n :title))
+                        (class (markup-class n)))
+                     (if class
+                         (let ((title-class (string-append class "-title")))
+                           ;; When a class is specified, let the user play
+                           ;; with CSS.
+                           (format #t "\n<div class=\"~a\">" class)
+                           (format #t "\n<a name=\"~a\"></a>\n"
+                                   (markup-ident n))
+                           (format #t "<div class=\"~a\">" title-class)
+                           (format #t "~a / ~a -- " nb (slide-number))
+                           (output t e)
+                           (display "</div>\n")
+                           (output (markup-body n) e)
+                           (display "\n</div>\n"))
+                         ;; When no class is specified, do HTML tricks.
+                         (evaluate-document
+                          (center
+                           (color :width (slide-body-width e)
+                                  :bg (or (markup-option n :bg) "#ffffff")
+                                  (table :width 100.
+                                         (tr (th :align 'left
+                                                 (list
+                                                  (if nb
+                                                      (format #f "~a / ~a -- "
+                                                              nb
+                                                              (slide-number)))
+                                                  t)))
+                                         (tr (td (hrule)))
+                                         (tr (td :width 100. :align 'left
+                                                 (markup-body n))))
+                                  (linebreak)))
+                          e))))
        :after "<br>")
+
     ;; slide-vspace
     (markup-writer 'slide-vspace he
        :action (lambda (n e) (display "<br>")))))
@@ -76,23 +110,23 @@
 	  (tbg (engine-custom e 'title-background))
 	  (tfg (engine-custom e 'title-foreground))
 	  (tfont (engine-custom e 'title-font)))
-      (printf "<center><table cellspacing='0' cellpadding='0' width=\"~a\" class=\"skribetitle\"><tbody>\n<tr>"
+      (format #t "<center><table cellspacing='0' cellpadding='0' width=\"~a\" class=\"skribilo-title\"><tbody>\n<tr>"
 	      (html-width (slide-body-width e)))
       (if (string? tbg)
-	  (printf "<td bgcolor=\"~a\">" tbg)
+	  (format #t  "<td bgcolor=\"~a\">" tbg)
 	  (display "<td>"))
       (if (string? tfg)
-	  (printf "<font color=\"~a\">" tfg))
+	  (format #t  "<font color=\"~a\">" tfg))
       (if title
 	  (begin
 	     (display "<center>")
 	     (if (string? tfont)
 		 (begin
-		    (printf "<font ~a><strong>" tfont)
+		    (format #t  "<font ~a><strong>" tfont)
 		    (output title e)
 		    (display "</strong></font>"))
 		 (begin
-		    (printf "<div class=\"skribetitle\"><strong><big><big><big>")
+		    (display "<div class=\"skribilo-title\"><strong><big><big><big>")
 		    (output title e)
 		    (display "</big></big></big></strong</div>")))
 	     (display "</center>\n")))
@@ -113,22 +147,43 @@
    :options '(:title :outline? :class :ident)
    :action (lambda (n e)
 	      (let ((title (markup-option n :title))
-		    (body (markup-body n)))
-		 (display "\n<h2 class=\"slide-topic:title\">")
+		    (body (markup-body n))
+                    (class (markup-class n)))
+                 ;; top-level class
+                 (if class (format #t "\n<div class=\"~a\">" class))
+
+                 ;; the title
+                 (if class
+                     (format #t "\n<div class=\"~a-title\">" class)
+                     (display "\n<h2 class=\"slide-topic:title\">"))
 		 (if (markup-ident n)
-		     (printf "<a name=\"~a\"></a>" (markup-ident n)))
+		     (format #t "<a name=\"~a\"></a>" (markup-ident n)))
 		 (output title e)
-		 (display "</h2> <br>\n")
-		 (display "\n<div class=\"slide-topic:slide-list\">")
+                 (if class
+                     (display "</div>\n")
+                     (display "</h2> <br>\n"))
+
+                 ;; pointers to the slides
+                 (if class
+                     (format #t "\n<div class=\"~a-slide-list\">"
+                             class)
+                     (display "\n<div class=\"slide-topic:slide-list\">"))
 		 (for-each (lambda (s)
-			      (output (markup-option s :title) e)
-			      (display "&nbsp;--&nbsp;"))
+                             (let* ((title (markup-option s :title))
+                                    (ident (markup-ident s))
+                                    (sref (ref :text title :ident ident))
+                                    (sref* (resolve! sref e `((parent ,n)))))
+                               (output sref* e)
+                               (display "&nbsp;--&nbsp;")))
 			   (filter (lambda (n)
 				      (or (is-markup? n 'slide-subtopic)
 					  (is-markup? n 'slide)))
 				   (markup-body n)))
 		 (display "\n</div> <!-- slide-topic:slide-list -->")
-		 (display "\n<hr><br>\n")
+
+                 (if class
+                     (display "\n</div> <!-- slide-topic -->\n")
+                     (display "\n<hr><br>\n"))
 
 		 ;; the slides
 		 (output (markup-body n) e))))
-- 
cgit v1.2.3


From 3fbd7575228bd70bf077272f7c1a6320e3f94084 Mon Sep 17 00:00:00 2001
From: Ludovic Court`es
Date: Wed, 25 Oct 2006 15:05:17 +0000
Subject: slide/html: Issue only one anchor per slide.

* src/guile/skribilo/package/slide/html.scm
  (%slide-html-initialize!)[slide]: Issue only one anchor per slide.

git-archimport-id: skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-11
---
 src/guile/skribilo/package/slide/html.scm | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

(limited to 'src')

diff --git a/src/guile/skribilo/package/slide/html.scm b/src/guile/skribilo/package/slide/html.scm
index 8fcbfed..024e1fd 100644
--- a/src/guile/skribilo/package/slide/html.scm
+++ b/src/guile/skribilo/package/slide/html.scm
@@ -50,8 +50,8 @@
     (markup-writer 'slide he
        :options '(:title :number :transition :toc :bg)
        :before (lambda (n e)
-		  (format #t "<a name=\"~a\">" (markup-ident n))
-		  (display "<br>\n"))
+                  (display "<br>\n")
+		  (format #t "<a name=\"~a\">" (markup-ident n)))
        :action (lambda (n e)
 		  (let ((nb (markup-option n :number))
 			(t (markup-option n :title))
@@ -61,8 +61,6 @@
                            ;; When a class is specified, let the user play
                            ;; with CSS.
                            (format #t "\n<div class=\"~a\">" class)
-                           (format #t "\n<a name=\"~a\"></a>\n"
-                                   (markup-ident n))
                            (format #t "<div class=\"~a\">" title-class)
                            (format #t "~a / ~a -- " nb (slide-number))
                            (output t e)
-- 
cgit v1.2.3


From 5708adbcc1e6b4333f675fb98130beca8b92c506 Mon Sep 17 00:00:00 2001
From: Ludovic Court`es
Date: Sat, 11 Nov 2006 17:40:09 +0000
Subject: lout engine: Fixed the default value of `lout-program-arguments'.

* src/guile/skribilo/engine/lout.scm (lout-engine): Set default value of
  `lout-program-arguments' to `()'.


git-archimport-id: skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-12
---
 src/guile/skribilo/engine/lout.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src')

diff --git a/src/guile/skribilo/engine/lout.scm b/src/guile/skribilo/engine/lout.scm
index 9b25f30..ddbb7b7 100644
--- a/src/guile/skribilo/engine/lout.scm
+++ b/src/guile/skribilo/engine/lout.scm
@@ -659,7 +659,7 @@
 
                          ;; Additional arguments that should be passed to
                          ;; Lout, e.g., `("-I foo" "-I bar")'.
-                         (lout-program-arguments '())
+                         (lout-program-arguments ())
 
 			 ;; Title and author information in the PDF
 			 ;; document information.  If `#t', the
-- 
cgit v1.2.3


From 3d912da3bea0c47492125f59ae71209116fa522a Mon Sep 17 00:00:00 2001
From: Ludovic Courtes
Date: Sun, 12 Nov 2006 12:54:10 +0000
Subject: Added the `(skribilo biblio template)' module.

* src/guile/skribilo/engine/base.scm: Autoload `(skribilo biblio
  template)'.
  (&bib-entry-url): New writer.
  (&bib-entry-body)[output-fields]: Removed.  Moved to the new module as
  `output-bib-entry-template'.  Use it, as well as
  `make-bib-entry-template/default'.
  (&bib-entry-title): Don't produce bold text.
  (&bib-entry-booktitle): New writer.
  (&bib-entry-journal): New writer.

* src/guile/skribilo/biblio/Makefile.am (dist_guilemodule_DATA): Added
  `template.scm'.

git-archimport-id: skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-13
---
 ChangeLog                              | 199 +++++++++++++++++++++++++++++++++
 src/guile/skribilo/biblio/Makefile.am  |   2 +-
 src/guile/skribilo/biblio/template.scm | 194 ++++++++++++++++++++++++++++++++
 src/guile/skribilo/engine/base.scm     | 121 +++++++-------------
 4 files changed, 433 insertions(+), 83 deletions(-)
 create mode 100644 src/guile/skribilo/biblio/template.scm

(limited to 'src')

diff --git a/ChangeLog b/ChangeLog
index 9b5753b..ba057f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,106 @@
 # arch-tag: automatic-ChangeLog--lcourtes@laas.fr--2005-mobile/skribilo--devel--1.2
 #
 
+2006-11-11 22:59:55 GMT	Ludovic Courtes <ludovic.courtes@laas.fr>	patch-82
+
+    Summary:
+      Added the `(skribilo biblio template)' module.
+    Revision:
+      skribilo--devel--1.2--patch-82
+
+    * src/guile/skribilo/engine/base.scm: Autoload `(skribilo biblio
+      template)'.
+      (&bib-entry-url): New writer.
+      (&bib-entry-body)[output-fields]: Removed.  Moved to the new module as
+      `output-bib-entry-template'.  Use it, as well as
+      `make-bib-entry-template/default'.
+      (&bib-entry-title): Don't produce bold text.
+      (&bib-entry-booktitle): New writer.
+      (&bib-entry-journal): New writer.
+    
+    * src/guile/skribilo/biblio/Makefile.am (dist_guilemodule_DATA): Added
+      `template.scm'.
+
+    new files:
+     src/guile/skribilo/biblio/template.scm
+
+    modified files:
+     ChangeLog src/guile/skribilo/biblio/Makefile.am
+     src/guile/skribilo/engine/base.scm
+
+
+2006-11-11 17:44:08 GMT	Ludovic Courtes <ludovic.courtes@laas.fr>	patch-81
+
+    Summary:
+      Merge from skribilo@sv.gnu.org--2006/skribilo--devo--1.2
+    Revision:
+      skribilo--devel--1.2--patch-81
+
+    Patches applied:
+    
+     * lcourtes@laas.fr--2005-libre/skribilo--devo--1.2  (patch 71)
+     * skribilo@sv.gnu.org--2006/skribilo--devo--1.2  (patch 12)
+    
+       - lout engine: Fixed the default value of `lout-program-arguments'.
+
+    modified files:
+     ChangeLog src/guile/skribilo/engine/lout.scm
+
+    new patches:
+     lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-71
+     skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-12
+
+
+2006-11-11 17:03:53 GMT	Ludovic Courtes <ludovic.courtes@laas.fr>	patch-80
+
+    Summary:
+      Merge from skribilo@sv.gnu.org--2006/skribilo--devo--1.2
+    Revision:
+      skribilo--devel--1.2--patch-80
+
+    Patches applied:
+    
+     * lcourtes@laas.fr--2005-libre/skribilo--devo--1.2  (patch 65-70)
+    
+       - Merge from skribilo@sv.gnu.org--2006
+       - Added a `:arguments' keyword to `slide-embed'.
+       - Lout engine: Implemented `slide-embed'.
+       - Lout engine: Added a `lout-program-arguments' custom.
+       - slide: Improved HTML output, especially wrt. the use of CSS.
+       - slide/html: Issue only one anchor per slide.
+    
+     * skribilo@sv.gnu.org--2006/skribilo--devo--1.2  (patch 6-11)
+    
+       - color.scm: Added support for `lightred'.  :-)
+       - Added a `:arguments' keyword to `slide-embed'.
+       - Lout engine: Implemented `slide-embed'.
+       - Lout engine: Added a `lout-program-arguments' custom.
+       - slide: Improved HTML output, especially wrt. the use of CSS.
+       - slide/html: Issue only one anchor per slide.
+
+    modified files:
+     ChangeLog doc/user/slide.skb
+     src/guile/skribilo/engine/lout.scm
+     src/guile/skribilo/package/slide.scm
+     src/guile/skribilo/package/slide/base.scm
+     src/guile/skribilo/package/slide/html.scm
+     src/guile/skribilo/package/slide/lout.scm
+
+    new patches:
+     lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-65
+     lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-66
+     lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-67
+     lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-68
+     lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-69
+     lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-70
+     skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-6
+     skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-7
+     skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-8
+     skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-9
+     skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-10
+     skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-11
+
+
 2006-10-16 21:09:47 GMT	Ludovic Courtes <ludovic.courtes@laas.fr>	patch-79
 
     Summary:
@@ -15,6 +115,105 @@
      ChangeLog src/guile/skribilo/color.scm
 
 
+2006-10-16 18:20:03 GMT	Ludovic Courtes <ludovic.courtes@laas.fr>	patch-78
+
+    Summary:
+      Merge from skribilo@sv.gnu.org--2006/skribilo--devo--1.2
+    Revision:
+      skribilo--devel--1.2--patch-78
+
+    Patches applied:
+    
+     * lcourtes@laas.fr--2005-libre/skribilo--devo--1.2  (patch 64)
+     * skribilo@sv.gnu.org--2006/skribilo--devo--1.2  (patch 5)
+    
+       - Lout engine: Honor `inline-definitions-proc'.
+
+    modified files:
+     ChangeLog src/guile/skribilo/engine/lout.scm
+
+    new patches:
+     lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-64
+     skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-5
+
+
+2006-10-15 20:46:11 GMT	Ludovic Courtes <ludovic.courtes@laas.fr>	patch-77
+
+    Summary:
+      Merge from skribilo@sv.gnu.org--2006/skribilo--devo--1.2
+    Revision:
+      skribilo--devel--1.2--patch-77
+
+    Patches applied:
+    
+     * lcourtes@laas.fr--2005-libre/skribilo--devo--1.2  (patch 62-63)
+     * skribilo@sv.gnu.org--2006/skribilo--devo--1.2  (patch 3-4)
+    
+       - prog: Fixed line number output (`&prog-line').
+       - doc: Fixed the Fibonacci example in ``Computer Programs''.
+
+    modified files:
+     ChangeLog doc/user/prgm.skb doc/user/src/prgm2.skb
+     src/guile/skribilo/engine/base.scm src/guile/skribilo/prog.scm
+
+    new patches:
+     lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-62
+     lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-63
+     skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-3
+     skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-4
+
+
+2006-10-11 07:55:00 GMT	Ludovic Courtes <ludovic.courtes@laas.fr>	patch-76
+
+    Summary:
+      Merge from skribilo@sv.gnu.org--2006/skribilo--devo--1.2
+    Revision:
+      skribilo--devel--1.2--patch-76
+
+    Patches applied:
+    
+     * lcourtes@laas.fr--2005-libre/skribilo--devo--1.2  (patch 60-61)
+    
+       - slide: Propagate the `outline?' parameter in `slide-(sub)?topic'.
+       - Lout engine: Honor `date-line' for slides.
+    
+     * skribilo@sv.gnu.org--2006/skribilo--devo--1.2  (base, patch 1-2)
+    
+       - tag of lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-59
+       - slide: Propagate the `outline?' parameter in `slide-(sub)?topic'.
+       - Lout engine: Honor `date-line' for slides.
+
+    modified files:
+     ChangeLog src/guile/skribilo/engine/lout.scm
+     src/guile/skribilo/package/slide.scm
+
+    new patches:
+     lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-60
+     lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-61
+     skribilo@sv.gnu.org--2006/skribilo--devo--1.2--base-0
+     skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-1
+     skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-2
+
+
+2006-09-14 17:31:46 GMT	Ludovic Courtes <ludovic.courtes@laas.fr>	patch-75
+
+    Summary:
+      Adding missing patch logs from `lcourtes@laas.fr--2005-libre'.
+    Revision:
+      skribilo--devel--1.2--patch-75
+
+
+    modified files:
+     ChangeLog
+
+    new patches:
+     lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-55
+     lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-56
+     lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-57
+     lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-58
+     lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-59
+
+
 2006-09-04 09:15:58 GMT	Ludovic Courtes <ludovic.courtes@laas.fr>	patch-74
 
     Summary:
diff --git a/src/guile/skribilo/biblio/Makefile.am b/src/guile/skribilo/biblio/Makefile.am
index 9442562..ee81406 100644
--- a/src/guile/skribilo/biblio/Makefile.am
+++ b/src/guile/skribilo/biblio/Makefile.am
@@ -1,4 +1,4 @@
 guilemoduledir = $(GUILE_SITE)/skribilo/biblio
-dist_guilemodule_DATA = bibtex.scm author.scm abbrev.scm
+dist_guilemodule_DATA = bibtex.scm author.scm abbrev.scm template.scm
 
 ## arch-tag: aeffaead-c3f0-47f3-a0b3-bb3e22da2657
diff --git a/src/guile/skribilo/biblio/template.scm b/src/guile/skribilo/biblio/template.scm
new file mode 100644
index 0000000..da0c948
--- /dev/null
+++ b/src/guile/skribilo/biblio/template.scm
@@ -0,0 +1,194 @@
+;;; template.scm  --  Template system for bibliography entries.
+;;;
+;;; Copyright 2003, 2004  Manuel Serrano
+;;; Copyright 2006  Ludovic Court�s <ludovic.courtes@laas.fr>
+;;;
+;;;
+;;; This program is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 2 of the License, or
+;;; (at your option) any later version.
+;;;
+;;; This program is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with this program; if not, write to the Free Software
+;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+;;; USA.
+
+(define-module (skribilo biblio template)
+  :use-module (skribilo ast)
+  :autoload   (skribilo lib)    (skribe-error)
+  :autoload   (skribilo output) (output)
+
+  :use-module (ice-9 optargs)
+
+  :use-module (skribilo utils syntax)
+
+  :export (output-bib-entry-template
+           make-bib-entry-template/default
+           make-bib-entry-template/skribe))
+
+(fluid-set! current-reader %skribilo-module-reader)
+
+;;; Author: Manuel Serrano, Ludovic Court�s
+;;;
+;;; Commentary:
+;;;
+;;; This module provides a helper procedure to output bibliography entries
+;;; according to a given template, as well as ready-to-use templates.  A
+;;; template only contains part of the style information for a bibliography
+;;; entry.  Specific style information can be added by modifying the markup
+;;; writers for `&bib-entry-author', `&bib-entry-title', etc. (see `(skribilo
+;;; package base)' for details).
+;;;
+;;; Code:
+
+
+;;;
+;;; Outputting a bibliography entry template for a specific entry.
+;;;
+
+(define* (output-bib-entry-template bib engine template
+                                    :optional (get-field markup-option))
+  ;; Output the fields of BIB (a bibliography entry) for ENGINE according to
+  ;; TEMPLATE.  Example of templates are found below (e.g.,
+  ;; `make-bib-entry-template/default').
+  (let loop ((template template)
+             (pending #f)
+             (armed #f))
+    (cond
+     ((null? template)
+      'done)
+     ((pair? (car template))
+      (if (eq? (caar template) 'or)
+          (let ((o1 (cadr (car template))))
+            (if (get-field bib o1)
+                (loop (cons o1 (cdr template))
+                      pending
+                      #t)
+                (let ((o2 (caddr (car template))))
+                  (loop (cons o2 (cdr template))
+                        pending
+                        armed))))
+          (let ((o (get-field bib (cadr (car template)))))
+            (if o
+                (begin
+                  (if (and pending armed)
+                      (output pending engine))
+                  (output (caar template) engine)
+                  (output o engine)
+                  (if (pair? (cddr (car template)))
+                      (output (caddr (car template)) engine))
+                  (loop (cdr template) #f #t))
+                (loop (cdr template) pending armed)))))
+     ((symbol? (car template))
+      (let ((o (get-field bib (car template))))
+        (if o
+            (begin
+              (if (and armed pending)
+                  (output pending engine))
+              (output o engine)
+              (loop (cdr template) #f #t))
+            (loop (cdr template) pending armed))))
+     ((null? (cdr template))
+      (output (car template) engine))
+     ((string? (car template))
+      (loop (cdr template)
+            (if pending pending (car template))
+            armed))
+     (else
+      (skribe-error 'output-bib-fields
+                    "Illegal templateiption"
+                    (car template))))))
+
+
+;;;
+;;; Example bibliography entry templates.
+;;;
+
+(define (make-bib-entry-template/default kind)
+  ;; The default bibliography entry template.
+  (case kind
+    ((techreport)
+     `(author ". " (or title url documenturl) ". "
+              number ", " institution ", "
+              address ", " month " " year ", "
+              ("pp. " pages) "."))
+    ((article)
+     `(author ". " (or title url documenturl) ". "
+              "In " journal ", " volume
+              ("(" number ")") ", "
+              address ", " month " " year ", "
+              ("pp. " pages) "."))
+    ((inproceedings)
+     `(author ". " (or title url documenturl) ". "
+              "In " booktitle ", "
+              (series ", ")
+              ("(" number ")")
+              ("pp. " pages ", ")
+              ;; FIXME:  Addr., month., pub.
+              year "."))
+    ((book) ;; FIXME:  Title should be in italics
+     '(author ". " (or title url documenturl) ". "
+              publisher ", " address
+              ", " month " " year ", "
+              ("pp. " pages) "."))
+    ((phdthesis)
+     '(author ". " (or title url documenturl)
+              ". " type ", "
+              school ", " address
+              ", " month " " year"."))
+    ((misc)
+     '(author ". " (or title url documenturl) ". "
+              publisher ", " address
+              ", " month " " year
+              (", " url) "."))
+    (else
+     '(author ". " (or title url documenturl) ". "
+              publisher ", " address
+              ", " month " " year ", "
+              ("pp. " pages) "."))))
+
+(define (make-bib-entry-template/skribe kind)
+  ;; The awful template found by default in Skribe.
+  (case kind
+    ((techreport)
+     `(author " -- " (or title url documenturl) " -- "
+              number ", " institution ", "
+              address ", " month ", " year ", "
+              ("pp. " pages) "."))
+    ((article)
+     `(author " -- " (or title url documenturl) " -- "
+              journal ", " volume "" ("(" number ")") ", "
+              address ", " month ", " year ", "
+              ("pp. " pages) "."))
+    ((inproceedings)
+     `(author " -- " (or title url documenturl) " -- "
+              booktitle ", " series ", " ("(" number ")") ", "
+              address ", " month ", " year ", "
+              ("pp. " pages) "."))
+    ((book)
+     '(author " -- " (or title url documenturl) " -- "
+              publisher ", " address
+              ", " month ", " year ", " ("pp. " pages) "."))
+    ((phdthesis)
+     '(author " -- " (or title url documenturl) " -- " type ", "
+              school ", " address
+              ", " month ", " year"."))
+    ((misc)
+     '(author " -- " (or title url documenturl) " -- "
+              publisher ", " address
+              ", " month ", " year"."))
+    (else
+     '(author " -- " (or title url documenturl) " -- "
+              publisher ", " address
+              ", " month ", " year ", " ("pp. " pages) "."))))
+
+
+;;; arch-tag: 5931579f-b606-442d-9a45-6047c94da5a2
+
+;;; template.scm ends here
diff --git a/src/guile/skribilo/engine/base.scm b/src/guile/skribilo/engine/base.scm
index d49b732..3b70f66 100644
--- a/src/guile/skribilo/engine/base.scm
+++ b/src/guile/skribilo/engine/base.scm
@@ -20,6 +20,8 @@
 ;;; USA.
 
 (define-skribe-module (skribilo engine base)
+  :autoload (skribilo biblio template) (make-bib-entry-template/default
+                                        output-bib-entry-template)
   :use-module (srfi srfi-13))
 
 ;*---------------------------------------------------------------------*/
@@ -217,92 +219,32 @@
    :action (lambda (n e) (output (markup-option n :title) e))
    :after "]")
 
+;*---------------------------------------------------------------------*/
+;*    &bib-entry-author ...                                            */
+;*---------------------------------------------------------------------*/
+; (markup-writer '&bib-entry-author
+;                :action (lambda (n e)
+;                          (let ((names (markup-body n)))
+;                            (skribe-eval
+;                             (sc (abbreviate-first-names names)) e))))
+
+;*---------------------------------------------------------------------*/
+;*    &bib-entry-url ...                                               */
+;*---------------------------------------------------------------------*/
+(markup-writer '&bib-entry-url
+               :action (lambda (n e)
+                         (let ((url (markup-body n)))
+                           (skribe-eval
+                            (ref :text (it url) :url url) e))))
+
 ;*---------------------------------------------------------------------*/
 ;*    &bib-entry-body ...                                              */
 ;*---------------------------------------------------------------------*/
 (markup-writer '&bib-entry-body
    :action (lambda (n e)
-	      (define (output-fields descr)
-		 (let loop ((descr descr)
-			    (pending #f)
-			    (armed #f))
-		    (cond
-		       ((null? descr)
-			'done)
-		       ((pair? (car descr))
-			(if (eq? (caar descr) 'or)
-			    (let ((o1 (cadr (car descr))))
-			       (if (markup-option n o1)
-				   (loop (cons o1 (cdr descr))
-					 pending
-					 #t)
-				   (let ((o2 (caddr (car descr))))
-				      (loop (cons o2 (cdr descr))
-					    pending
-					    armed))))
-			    (let ((o (markup-option n (cadr (car descr)))))
-			       (if o
-				   (begin
-				      (if (and pending armed)
-					  (output pending e))
-				      (output (caar descr) e)
-				      (output o e)
-				      (if (pair? (cddr (car descr)))
-					  (output (caddr (car descr)) e))
-				      (loop (cdr descr) #f #t))
-				   (loop (cdr descr) pending armed)))))
-		       ((symbol? (car descr))
-			(let ((o (markup-option n (car descr))))
-			   (if o
-			       (begin
-				  (if (and armed pending)
-				      (output pending e))
-				  (output o e)
-				  (loop (cdr descr) #f #t))
-			       (loop (cdr descr) pending armed))))
-		       ((null? (cdr descr))
-			(output (car descr) e))
-		       ((string? (car descr))
-			(loop (cdr descr)
-			      (if pending pending (car descr))
-			      armed))
-		       (else
-			(skribe-error 'output-bib-fields
-				      "Illegal description"
-				      (car descr))))))
-	      (output-fields
-	       (case (markup-option n 'kind)
-		  ((techreport)
-		   `(author " -- " (or title url documenturl) " -- "
-			    number ", " institution ", "
-			    address ", " month ", " year ", "
-			    ("pp. " pages) "."))
-		  ((article)
-		   `(author " -- " (or title url documenturl) " -- "
-			    journal ", " volume "" ("(" number ")") ", "
-			    address ", " month ", " year ", "
-			    ("pp. " pages) "."))
-		  ((inproceedings)
-		   `(author " -- " (or title url documenturl) " -- "
-			    booktitle ", " series ", " ("(" number ")") ", "
-			    address ", " month ", " year ", "
-			    ("pp. " pages) "."))
-		  ((book)
-		   '(author " -- " (or title url documenturl) " -- "
-			    publisher ", " address
-			    ", " month ", " year ", " ("pp. " pages) "."))
-		  ((phdthesis)
-		   '(author " -- " (or title url documenturl) " -- " type ", "
-			    school ", " address
-			    ", " month ", " year"."))
-		  ((misc)
-		   '(author " -- " (or title url documenturl) " -- "
-			    publisher ", " address
-			    ", " month ", " year"."))
-		  (else
-		   '(author " -- " (or title url documenturl) " -- "
-			    publisher ", " address
-			    ", " month ", " year ", " ("pp. " pages) "."))))))
+	      (let* ((kind (markup-option n 'kind))
+                     (template (make-bib-entry-template/default kind)))
+                (output-bib-entry-template n e template))))
 
 ;*---------------------------------------------------------------------*/
 ;*    &bib-entry-ident ...                                             */
@@ -316,7 +258,22 @@
 ;*---------------------------------------------------------------------*/
 (markup-writer '&bib-entry-title
    :action (lambda (n e)
-	      (skribe-eval (bold (markup-body n)) e)))
+	      (skribe-eval (markup-body n)) e))
+
+;*---------------------------------------------------------------------*/
+;*    &bib-entry-booktitle ...                                         */
+;*---------------------------------------------------------------------*/
+(markup-writer '&bib-entry-booktitle
+               :action (lambda (n e)
+                         (let ((title (markup-body n)))
+                           (skribe-eval (it title) e))))
+
+;*---------------------------------------------------------------------*/
+;*    &bib-entry-journal ...                                           */
+;*---------------------------------------------------------------------*/
+(markup-writer '&bib-entry-journal
+               :action (lambda (n e)
+                         (skribe-eval (it (markup-body n)) e)))
 
 ;*---------------------------------------------------------------------*/
 ;*    &bib-entry-publisher ...                                         */
-- 
cgit v1.2.3


From ac3be3e363a8c8b496f5eeff5ac6c62f2b14780e Mon Sep 17 00:00:00 2001
From: Ludovic Courtes
Date: Sun, 12 Nov 2006 12:55:51 +0000
Subject: Lout engine: Make URLs breakable; make bibliography defaults sane.

* src/guile/skribilo/engine/lout.scm (lout-split-external-link): Use
  `!lout' and `lout-make-url-breakable'.
  (lout-make-url-breakable): New, taken from `url-ref'.
  (url-ref): Use it.
  (&bib-entry-title): Don't issue bold text.
  (&bib-entry-url): Likewise.

git-archimport-id: skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-14
---
 ChangeLog                          | 18 ++++++++++++++++++
 src/guile/skribilo/engine/lout.scm | 36 ++++++++++++++++++++----------------
 2 files changed, 38 insertions(+), 16 deletions(-)

(limited to 'src')

diff --git a/ChangeLog b/ChangeLog
index ba057f9..f0cafb4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,24 @@
 # arch-tag: automatic-ChangeLog--lcourtes@laas.fr--2005-mobile/skribilo--devel--1.2
 #
 
+2006-11-11 23:02:57 GMT	Ludovic Courtes <ludovic.courtes@laas.fr>	patch-83
+
+    Summary:
+      Lout engine: Make URLs breakable; make bibliography defaults sane.
+    Revision:
+      skribilo--devel--1.2--patch-83
+
+    * src/guile/skribilo/engine/lout.scm (lout-split-external-link): Use
+      `!lout' and `lout-make-url-breakable'.
+      (lout-make-url-breakable): New, taken from `url-ref'.
+      (url-ref): Use it.
+      (&bib-entry-title): Don't issue bold text.
+      (&bib-entry-url): Likewise.
+
+    modified files:
+     ChangeLog src/guile/skribilo/engine/lout.scm
+
+
 2006-11-11 22:59:55 GMT	Ludovic Courtes <ludovic.courtes@laas.fr>	patch-82
 
     Summary:
diff --git a/src/guile/skribilo/engine/lout.scm b/src/guile/skribilo/engine/lout.scm
index ddbb7b7..92977e7 100644
--- a/src/guile/skribilo/engine/lout.scm
+++ b/src/guile/skribilo/engine/lout.scm
@@ -472,7 +472,8 @@
 					(loop (- where 1))
 					where)))))
 		   `(,(ref :url url :text (substring text 0 split))
-		     ,(substring text split len)))
+		     ,(!lout (lout-make-url-breakable
+                              (substring text split len)))))
 		 (list markup))))
 
 	  ((markup? text)
@@ -2518,6 +2519,19 @@
 			 (loop (cdr rs)))))))))
    :after "]")
 
+;*---------------------------------------------------------------------*/
+;*    lout-make-url-breakable ...                                      */
+;*---------------------------------------------------------------------*/
+(define-public lout-make-url-breakable
+  ;; Make the given string (which is assumed to be a URL) breakable.
+  (make-string-replace `((#\/ "\"/\"&0ik{}")
+                         (#\. ".&0ik{}")
+                         (#\- "-&0ik{}")
+                         (#\_ "_&0ik{}")
+                         (#\@ "\"@\"&0ik{}")
+                         ,@lout-verbatim-encoding
+                         (#\newline ""))))
+
 ;*---------------------------------------------------------------------*/
 ;*    url-ref ...                                                      */
 ;*---------------------------------------------------------------------*/
@@ -2531,19 +2545,9 @@
 		       (markup-option n '&transformed))
 		   (begin
 		     (printf "{ \"~a\" @ExternalLink { " url)
-		     (if text ;; FIXME: Should be (not (string-index text #\space))
-			 (output text e)
-			 (let ((filter-url (make-string-replace
-					    `((#\/ "\"/\"&-")
-					      (#\. ".&-")
-					      (#\- "&-")
-					      (#\_ "_&-")
-					      ,@lout-verbatim-encoding
-					      (#\newline "")))))
-			   ;; Filter the URL in a way to give Lout hints on
-			   ;; where hyphenation should take place.
-			   (fprint (current-error-port) "Here!!!" filter-url)
-			   (display (filter-url url) e)))
+		     (if text
+                         (output text e)
+                         (display (lout-make-url-breakable url) e))
 		     (printf " } }"))
 		   (begin
 		     (markup-option-add! n '&transformed #t)
@@ -2630,7 +2634,7 @@
 ;*---------------------------------------------------------------------*/
 (markup-writer '&bib-entry-title
    :action (lambda (n e)
-	      (let* ((t (bold (markup-body n)))
+	      (let* ((t (markup-body n))
 		     (en (handle-ast (ast-parent n)))
 		     (url (markup-option en 'url))
 		     (ht (if url (ref :url (markup-body url) :text t) t)))
@@ -2652,7 +2656,7 @@
    :action (lambda (n e)
 	      (let* ((en (handle-ast (ast-parent n)))
 		     (url (markup-option en 'url))
-		     (t (bold (markup-body url))))
+		     (t (it (markup-body url))))
 		 (skribe-eval (ref :url (markup-body url) :text t) e))))
 
 ;*---------------------------------------------------------------------*/
-- 
cgit v1.2.3