diff --git a/ha-programming.org b/ha-programming.org index 60bd8aa..d7780b1 100644 --- a/ha-programming.org +++ b/ha-programming.org @@ -1166,15 +1166,36 @@ Also, I like Markdown is look like a word processor, similarly to my org files: #+end_src Note that the markdown-specific commands use the ~C-c C-c~ and ~C-c C-s~ prefixes. -With the =markdown-header-scaling= set, we no longer need to color the headers in Markdown. +With the =markdown-header-scaling= set, we no longer need to color the headers in Markdown, nor many of the /garish/ colors. #+begin_src emacs-lisp (use-package markdown-mode + :after org :config + (let ((default-color (face-attribute 'default :foreground))) + (set-face-attribute 'markdown-italic-face nil :foreground nil) + (set-face-attribute 'markdown-bold-face nil :foreground nil) + (set-face-attribute 'markdown-pre-face nil + :foreground (face-attribute 'org-code :foreground)) + (set-face-attribute 'markdown-code-face nil + :background (face-attribute 'org-block :background)) + (set-face-attribute 'markdown-language-keyword-face nil + :foreground (face-attribute 'org-block-begin-line :foreground)) + (set-face-attribute 'markdown-url-face nil + :foreground (face-attribute 'font-lock-comment-face :foreground)) + (set-face-attribute 'markdown-header-face nil + :font ha-variable-header-font + :foreground default-color)) (when window-system - (let ((default-color (face-attribute 'default :foreground))) - (set-face-attribute 'markdown-header-face nil - :font ha-variable-header-font - :foreground default-color)))) + (dolist (level '(1 2 3 4)) + (let ((md-level (make-face (make-symbol (format "markdown-header-face-%d" level)))) + (org-level (nth (1- level) org-level-faces))) + (message "Setting %s size %.1f to %s" org-level (face-attribute org-level :height) md-level) + (print `(set-face-attribute ,md-level nil + :height ,(face-attribute org-level :height))) + (set-face-attribute md-level nil + :height (face-attribute org-level :height)))))) + + #+end_src Both the =markdown-command= and the =markdown-open-command= variables are called to render (and preview) a Markdown file (~C-c C-c o~), and calls the following scripts (which in turn, call =pandoc= as I depend on this for other org-related features):