summaryrefslogtreecommitdiff
path: root/src/guile
diff options
context:
space:
mode:
authorLudovic Courtès2012-05-26 16:36:56 +0200
committerLudovic Courtès2012-05-27 22:34:41 +0200
commit5bf87ad42c1e4c361401af7786f552ee1242698f (patch)
treef0bd96c14a874a9a7beb2866d2215aff91eb572d /src/guile
parent5c69154f8ef9c10425d26ecb3a2c65f01b76959b (diff)
downloadskribilo-5bf87ad42c1e4c361401af7786f552ee1242698f.tar.gz
skribilo-5bf87ad42c1e4c361401af7786f552ee1242698f.tar.lz
skribilo-5bf87ad42c1e4c361401af7786f552ee1242698f.zip
info: Implement the `image' markup.
* src/guile/skribilo/engine/info.scm (image): New markup writer. * doc/user/infoe.skb (Info Engine): Mention image rendering.
Diffstat (limited to 'src/guile')
-rw-r--r--src/guile/skribilo/engine/info.scm21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/guile/skribilo/engine/info.scm b/src/guile/skribilo/engine/info.scm
index d25e584..06916d2 100644
--- a/src/guile/skribilo/engine/info.scm
+++ b/src/guile/skribilo/engine/info.scm
@@ -784,6 +784,27 @@
(output (markup-body n) e)
(output-flush *margin*)))
+;*---------------------------------------------------------------------*/
+;* info ::%image ... */
+;*---------------------------------------------------------------------*/
+(markup-writer 'image info-engine
+ :options '(:file :url :width :height)
+ :validate (lambda (n e)
+ (string? (markup-option n :file)))
+ :action (lambda (n e)
+ (if (markup-option n :url)
+ (skribe-warning/ast 1 n (_ "image URLs not supported"))
+ (let ((f (markup-option n :file))
+ (h (markup-option n :height))
+ (w (markup-option n :width)))
+ ;; The Info mode in Emacs 23+ supports just a few
+ ;; properties of the `image' tag, such as `alt' and `text';
+ ;; it doesn't support `height' and `width' (yet?).
+ (and (string? f)
+ (format #t "\n\0\b[image alt=\"~a\" ~:[~*~;width=\"~a\" ~]~:[~*~;height=\"~a\" ~]src=\"~a\"\0\b]~%"
+ (ast->string (markup-body n))
+ w w h h f))))))
+
;;; Local Variables:
;;; eval: (put 'markup-writer 'scheme-indent-function 2)
;;; End: