aboutsummaryrefslogtreecommitdiffstats
path: root/modules/init-markdown.el
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2019-01-22 15:45:41 -0500
committerJesús <heckyel@hyperbola.info>2019-01-22 15:45:41 -0500
commitced0fe8f9ef7cd16ade900bb34393c627f6d0c69 (patch)
tree350d3a0cbb87b12a36c0dc12537c56a75a2668ae /modules/init-markdown.el
parentd0f44d85466d7211d54e30970f29815842ff4180 (diff)
downloademacs-personal-ced0fe8f9ef7cd16ade900bb34393c627f6d0c69.tar.lz
emacs-personal-ced0fe8f9ef7cd16ade900bb34393c627f6d0c69.tar.xz
emacs-personal-ced0fe8f9ef7cd16ade900bb34393c627f6d0c69.zip
Change directory lisp/ to modules/
FS #2
Diffstat (limited to 'modules/init-markdown.el')
-rw-r--r--modules/init-markdown.el37
1 files changed, 37 insertions, 0 deletions
diff --git a/modules/init-markdown.el b/modules/init-markdown.el
new file mode 100644
index 0000000..b7032db
--- /dev/null
+++ b/modules/init-markdown.el
@@ -0,0 +1,37 @@
+;;; init-markdown.el --- .Emacs Configuration -*- lexical-binding: t -*-
+;;; Commentary:
+;;
+
+;;; Code:
+(use-package markdown-mode
+ :mode (("\\.markdown\\'" . markdown-mode)
+ ("\\.md\\'" . markdown-mode))
+
+ :config
+ ;;----------------------------------------------------------------------------
+ ;; 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 "<!DOCTYPE html>\n"
+ "<html>\n"
+ "<head>\n<title>")
+ (insert title)
+ (insert "</title>\n")
+ (insert "<meta charset=\"utf-8\" />\n")
+ (when (> (length markdown-css-paths) 0)
+ (insert (mapconcat 'markdown-stylesheet-link-string markdown-css-paths "\n")))
+ (insert "\n</head>\n\n"
+ "<body>\n\n")
+ (goto-char (point-max))
+ (insert "\n"
+ "</body>\n"
+ "</html>\n")))
+
+(provide 'init-markdown)
+
+;;; init-markdown.el ends here