diff options
author | Ludovic Court`es | 2006-11-13 09:28:36 +0000 |
---|---|---|
committer | Ludovic Court`es | 2006-11-13 09:28:36 +0000 |
commit | 335e750ba0c5dcc4a33216c2021e7c02068dc4e4 (patch) | |
tree | ca4f9cec5e706aca5d32351157dfcbf755244498 /src/guile/skribilo/engine/lout.scm | |
parent | 7aa414f8e82b4faa0742a22b9dc092a44dabdf9e (diff) | |
parent | ac3be3e363a8c8b496f5eeff5ac6c62f2b14780e (diff) | |
download | skribilo-335e750ba0c5dcc4a33216c2021e7c02068dc4e4.tar.gz skribilo-335e750ba0c5dcc4a33216c2021e7c02068dc4e4.tar.lz skribilo-335e750ba0c5dcc4a33216c2021e7c02068dc4e4.zip |
Merge from skribilo@sv.gnu.org--2006
Patches applied:
* lcourtes@laas.fr--2005-mobile/skribilo--devel--1.2 (patch 75-78, 80-83)
- Adding missing patch logs from `lcourtes@laas.fr--2005-libre'.
- Merge from skribilo@sv.gnu.org--2006/skribilo--devo--1.2
- Added the `(skribilo biblio template)' module.
- Lout engine: Make URLs breakable; make bibliography defaults sane.
* skribilo@sv.gnu.org--2006/skribilo--devo--1.2 (patch 7-14)
- 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.
- lout engine: Fixed the default value of `lout-program-arguments'.
- Added the `(skribilo biblio template)' module.
- Lout engine: Make URLs breakable; make bibliography defaults sane.
git-archimport-id: lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-72
Diffstat (limited to 'src/guile/skribilo/engine/lout.scm')
-rw-r--r-- | src/guile/skribilo/engine/lout.scm | 36 |
1 files changed, 20 insertions, 16 deletions
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) @@ -2519,6 +2520,19 @@ :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 ... */ ;*---------------------------------------------------------------------*/ (markup-writer '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)))) ;*---------------------------------------------------------------------*/ |