Created
October 23, 2019 20:01
-
-
Save charlag/73e8b81d9962dedb5d7d97774ab7250a to your computer and use it in GitHub Desktop.
gh-md.el
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 gh-md () | |
"Copy Replace current file's ORG contents replaced | |
with Github-flavoured ones. Works quite poorly for now." | |
(interactive) | |
(let ((real-buffer (current-buffer))) | |
(with-temp-buffer | |
(let ((temp-buffer (current-buffer))) | |
(with-current-buffer real-buffer | |
(copy-to-buffer temp-buffer (point-min) (point-max)) | |
)) | |
(while (search-forward "*" nil t) | |
(replace-match " ")) | |
(beginning-of-buffer) | |
(while (re-search-forward " TODO" nil t) | |
(replace-match " - [ ]")) | |
(beginning-of-buffer) | |
(while (re-search-forward " DONE" nil t) | |
(replace-match " - [x]")) | |
(clipboard-kill-ring-save (point-min) (point-max)) | |
) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment