Skip to content

Instantly share code, notes, and snippets.

Created July 14, 2013 16:42
What would you like to do?
(defun tapas-creole->bootstrap (struct)
"Transform STRUCT, a creole structure, into something bootstrapable.
HTML DIV elements are hacked into the structure wherever we find
an HR element. The HR elements are retained."
(let ((tx
(loop for e in struct
(if (eq (car e) 'hr)
(list '(hr) '(plugin-html . "</div><div class=\"section\">"))
(list e)))))
(append '((plugin-html . "<div>")) tx '((plugin-html . "</div>")))))
(defun tapas-creole (page destination)
(get-buffer-create "*testcreole*")))
(concat tapas-indexroot page)
:destination destination
:structure-transform-fn 'tapas-creole->bootstrap
:css (list "/-/bootstrap/css/bootstrap.css"
(when (called-interactively-p 'interactive)
(switch-to-buffer destination)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment