From d172fb6e48fe4e342f0d94eade1b108bed91cc00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Sun, 29 Jul 2018 20:12:28 -0500 Subject: Initial commit --- lisp/init-markdown.el | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 lisp/init-markdown.el (limited to 'lisp/init-markdown.el') diff --git a/lisp/init-markdown.el b/lisp/init-markdown.el new file mode 100644 index 0000000..47ca803 --- /dev/null +++ b/lisp/init-markdown.el @@ -0,0 +1,35 @@ +;;---------------------------------------------------------------------------- +;; Markdown mode +;;---------------------------------------------------------------------------- +(require-package 'markdown-mode) + +(autoload 'markdown-mode "markdown-mode" + "Major mode for editing Markdown files" t) +(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode)) +(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)) + +;;---------------------------------------------------------------------------- +;; Generated HTML 5 and UTF-8 with Markdown +;;---------------------------------------------------------------------------- +(eval-after-load "markdown-mode" + '(defalias 'markdown-add-xhtml-header-and-footer 'as/markdown-add-xhtml-header-and-footer)) + +(defun as/markdown-add-xhtml-header-and-footer (title) + "Wrap XHTML header and footer with given TITLE around current buffer." + (goto-char (point-min)) + (insert "\n" + "\n" + "\n") + (insert title) + (insert "\n") + (insert "\n") + (when (> (length markdown-css-paths) 0) + (insert (mapconcat 'markdown-stylesheet-link-string markdown-css-paths "\n"))) + (insert "\n\n\n" + "\n\n") + (goto-char (point-max)) + (insert "\n" + "\n" + "\n")) + +(provide 'init-markdown) -- cgit v1.2.3