Make Markdown less garish.

This commit is contained in:
Howard Abrams 2024-07-02 11:37:19 -07:00
parent e706db3394
commit 6a143bf60b

View file

@ -1166,15 +1166,36 @@ Also, I like Markdown is look like a word processor, similarly to my org files:
#+end_src #+end_src
Note that the markdown-specific commands use the ~C-c C-c~ and ~C-c C-s~ prefixes. 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 #+begin_src emacs-lisp
(use-package markdown-mode (use-package markdown-mode
:after org
:config :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 (when window-system
(let ((default-color (face-attribute 'default :foreground))) (dolist (level '(1 2 3 4))
(set-face-attribute 'markdown-header-face nil (let ((md-level (make-face (make-symbol (format "markdown-header-face-%d" level))))
:font ha-variable-header-font (org-level (nth (1- level) org-level-faces)))
:foreground default-color)))) (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 #+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): 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):