From 092304d9e0ccc37cc0ddaa9b136457e56a1cac20 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 12 Oct 2025 11:47:26 -0500 Subject: changing repositories --- modules/markdown-config.el | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 modules/markdown-config.el (limited to 'modules/markdown-config.el') diff --git a/modules/markdown-config.el b/modules/markdown-config.el new file mode 100644 index 00000000..438aea7e --- /dev/null +++ b/modules/markdown-config.el @@ -0,0 +1,47 @@ +;;; markdown-config --- Settings for Editing Markdown -*- lexical-binding: t; coding: utf-8; -*- +;; author Craig Jennings + +;;; Commentary: + +;;; Code: + +;;;; ------------------------- Markdown-Mode ------------------------- + +(use-package markdown-mode + :mode (("README\\.md\\'" . gfm-mode) + ("\\.md\\'" . markdown-mode) + ("\\.markdown\\'" . markdown-mode)) + :bind (:map markdown-mode-map + ("" . markdown-preview)) ;; use same key as compile for consistency + :init (setq markdown-command "multimarkdown")) + +;;;; ------------------------- Impatient-Mode ------------------------ + +;; allows for live previews of your html +;; see: https://github.com/skeeto/impatient-mode +(use-package impatient-mode + :defer t + :config + (setq imp-set-user-filter 'markdown-html)) + +;;;; --------------------- WIP: Markdown-Preview --------------------- + +;; the filter to apply to markdown before impatient-mode pushes it to the server +(defun markdown-preview () + (interactive) + (httpd-start) + (impatient-mode 1) + (setq imp-user-filter #'cj/markdown-html) + (cl-incf imp-last-state) + (imp--notify-clients) + ;; (browse-url-generic-function 'browse-url-xdg-open) + (browse-url-generic "https://localhost:8080/imp" 1)) + +(defun cj/markdown-html (buffer) + (princ (with-current-buffer buffer + (format "Impatient Markdown %s " + (buffer-substring-no-properties (point-min) (point-max)))) + (current-buffer))) + +(provide 'markdown-config) +;;; markdown-config.el ends here -- cgit v1.2.3