Created
July 10, 2009 10:42
-
-
Save calas/144398 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 haml-convert-rhtml-file (rhtmlFile hamlFile) | |
"Convierte un fichero rhtml en un haml y abre un nuevo buffer" | |
(interactive "fSelect rhtml file: \nFSelect output (haml) file: ") | |
(let ((comando (concat "/usr/local/bin/html2haml -r " | |
rhtmlFile | |
" " | |
hamlFile))) | |
(shell-command comando) | |
(find-file hamlFile))) | |
(defun haml-convert-region (beg end) | |
"Convierte la región seleccionada a código haml" | |
(interactive "r") | |
(let ((comando "/usr/local/bin/html2haml -r -s")) | |
(shell-command-on-region beg end comando (buffer-name) t))) | |
(defun haml-to-html-region (beg end) | |
"Convierte la región seleccionada a código html" | |
(interactive "r") | |
(let ((comando "/usr/local/bin/haml -s -c")) | |
(shell-command-on-region beg end comando (buffer-name) t))) | |
(defun haml-convert-buffer () | |
"Convierte el buffer seleccionado a código haml" | |
(interactive) | |
(let ((nuevoarchivo | |
(replace-regexp-in-string "erb$" "haml" (buffer-file-name)))) | |
(haml-convert-region (point-min) (point-max)) | |
(write-file nuevoarchivo))) | |
(defun sass-convert-region (beg end) | |
"Convierte la región seleccionada a código sass" | |
(interactive "r") | |
(let ((comando "/usr/local/bin/css2sass -s")) | |
(shell-command-on-region beg end comando (buffer-name) t))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment