Skip to content

Instantly share code, notes, and snippets.

Created July 14, 2013 16:42
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save nicferrier/5994882 to your computer and use it in GitHub Desktop.
(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