Created
April 23, 2016 13:30
-
-
Save emasaka/8139d58c89d9ade0639994be4dfa3698 to your computer and use it in GitHub Desktop.
hide code blocks in Markdown by outline.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
;; md-hide-codes.el: | |
;; hide code blocks in Markdown by outline.el | |
(require 'outline) | |
(defun md-hide-codes () | |
"hide code blocks in Markdown" | |
(interactive) | |
(save-excursion | |
(goto-char (point-min)) | |
(let ((start-point nil)) | |
(while (re-search-forward "^```" nil t) | |
(if (null start-point) | |
(setq start-point (point)) | |
(outline-flag-region start-point (match-beginning 0) t) | |
(setq start-point nil) ))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment