view src/testdir/test33.ok @ 7360:b20095ba6fc2 v7.4.985

commit https://github.com/vim/vim/commit/f2f6d297966ec0e357640b71a238e51afcaba6cc Author: Bram Moolenaar <Bram@vim.org> Date: Mon Dec 28 20:57:10 2015 +0100 patch 7.4.985 Problem: Can't build with Ruby 2.3.0. Solution: Use the new TypedData_XXX macro family instead of Data_XXX. Use TypedData. (Ken Takata)
author Christian Brabandt <cb@256bit.org>
date Mon, 28 Dec 2015 21:00:05 +0100
parents 3fc0f57ecb91
children
line wrap: on
line source

(defun html-file (base)
  (format nil "~(~A~).html" base))

(defmacro page (name title &rest body)
  (let ((ti (gensym)))
       `(with-open-file (*standard-output*
			 (html-file ,name)
			 :direction :output
			 :if-exists :supersede)
			(let ((,ti ,title))
			     (as title ,ti)
			     (with center 
				   (as h2 (string-upcase ,ti)))
			     (brs 3)
			     ,@body))))

;;; Utilities for generating links

(defmacro with-link (dest &rest body)
  `(progn
    (format t "<a href=\"~A\">" (html-file ,dest))
    ,@body
    (princ "</a>")))