Skip to content

Instantly share code, notes, and snippets.

@mrmt
Created December 26, 2011 02:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrmt/1520448 to your computer and use it in GitHub Desktop.
Save mrmt/1520448 to your computer and use it in GitHub Desktop.
convert wiki notation from wiliki to souceforge.jp
;; -*-emacs-lisp-*-
;; converting wiki notation from wiliki to souceforge.jp
(defun sf ()
"converting wiki notation from wiliki to souceforge.jp"
(interactive)
(save-excursion
;; heading
(goto-char (point-min))
(replace-regexp "^\* " "= ")
(goto-char (point-min))
(replace-regexp "^\*\* " "== ")
(goto-char (point-min))
(replace-regexp "^\*\*\* " "=== ")
;; itemize
(goto-char (point-min))
(replace-regexp "^- " " * ")
(goto-char (point-min))
(replace-regexp "^-- " " * ")
(goto-char (point-min))
(replace-regexp "^--- " " * ")
(goto-char (point-min))
(replace-regexp "^---- " " * ")
;; link
(goto-char (point-min))
(replace-string "[[" "[")
(goto-char (point-min))
(replace-string "]]" "]")
(goto-char (point-min))
;; table
(replace-string "|" "||")
(goto-char (point-min))
;; line break
(replace-string "~%" "[[BR]]")
(goto-char (point-min))
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment