Created
July 14, 2013 16:42
-
-
Save nicferrier/5994882 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 | |
append | |
(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) | |
(interactive | |
(list | |
"main.creole" | |
(get-buffer-create "*testcreole*"))) | |
(creole-wiki | |
(concat tapas-indexroot page) | |
:destination destination | |
:structure-transform-fn 'tapas-creole->bootstrap | |
:css (list "/-/bootstrap/css/bootstrap.css" | |
"/-/main.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