From 5bf87ad42c1e4c361401af7786f552ee1242698f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 26 May 2012 16:36:56 +0200 Subject: info: Implement the `image' markup. * src/guile/skribilo/engine/info.scm (image): New markup writer. * doc/user/infoe.skb (Info Engine): Mention image rendering. --- src/guile/skribilo/engine/info.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/guile') 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: -- cgit v1.2.3