Convert a program to markdown in Emacs lisp

This interactive Emacs lisp function converts the current buffer into markdown format.

(defun markdown ()
  "Convert a C or other program file to markdown"
  (interactive)
  (save-excursion
    (untabify (point-min) (point-max))
    (beginning-of-buffer)
    (while (re-search-forward "^" nil t)
      (replace-match "    "))))

(download)


Copyright © Ben Bullock 2009-2017. All rights reserved. For comments, questions, and corrections, please email Ben Bullock (benkasminbullock@gmail.com). / Privacy / Disclaimer