feat(markdown): Improve markdown editing experience
- Enable native code block fontification - Add htmlize package for HTML export - Add custom theme faces for markdown-mode headers, code and tables - Remove Emacs 31+ tree-sitter mode remapping
This commit is contained in:
@@ -46,11 +46,11 @@
|
|||||||
:hook
|
:hook
|
||||||
(markdown-mode . toggle-truncate-lines)
|
(markdown-mode . toggle-truncate-lines)
|
||||||
:init
|
:init
|
||||||
(setq markdown-command "multimarkdown")
|
(setq markdown-command "multimarkdown"
|
||||||
(when (>= emacs-major-version 31)
|
markdown-fontify-code-blocks-natively t))
|
||||||
(add-to-list 'major-mode-remap-alist
|
|
||||||
'(markdown-mode . markdown-ts-mode))
|
;; html
|
||||||
(add-hook 'markdown-ts-mode-hook #'toggle-truncate-lines)))
|
(use-package htmlize)
|
||||||
|
|
||||||
(provide 'init-prog)
|
(provide 'init-prog)
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,14 @@
|
|||||||
`(cal-china-x-important-holiday-face ((,class (:underline (:style line :color ,red)))))
|
`(cal-china-x-important-holiday-face ((,class (:underline (:style line :color ,red)))))
|
||||||
`(cal-china-x-general-holiday-face ((,class (:underline (:style line :color ,yellow)))))
|
`(cal-china-x-general-holiday-face ((,class (:underline (:style line :color ,yellow)))))
|
||||||
`(holiday ((,class (:underline (:style line :color ,yellow)))))
|
`(holiday ((,class (:underline (:style line :color ,yellow)))))
|
||||||
|
`(markdown-header-face-1 ((,class (:foreground ,orange :height 1.0 :weight normal))))
|
||||||
|
`(markdown-header-face-2 ((,class (:foreground ,blue :height 1.0 :weight normal))))
|
||||||
|
`(markdown-header-face-3 ((,class (:foreground ,green :height 1.0 :weight normal))))
|
||||||
|
`(markdown-header-face-4 ((,class (:foreground ,yellow :height 1.0 :weight normal))))
|
||||||
|
`(markdown-header-face-5 ((,class (:foreground ,cyan :height 1.0 :weight normal))))
|
||||||
|
`(markdown-header-face-6 ((,class (:foreground ,green :height 1.0 :weight normal))))
|
||||||
|
`(markdown-code-face ((,class (:foreground ,base0))))
|
||||||
|
`(markdown-table-face ((,class (:foreground ,green))))
|
||||||
`(font-lock-keyword-face ((,class (:foreground ,cyan :weight bold))))
|
`(font-lock-keyword-face ((,class (:foreground ,cyan :weight bold))))
|
||||||
`(font-lock-doc-face ((,class (:foreground ,green :slant normal))))
|
`(font-lock-doc-face ((,class (:foreground ,green :slant normal))))
|
||||||
`(font-lock-string-face ((,class (:foreground ,green))))
|
`(font-lock-string-face ((,class (:foreground ,green))))
|
||||||
|
|||||||
@@ -39,6 +39,14 @@
|
|||||||
`(cal-china-x-important-holiday-face ((,class (:underline (:style line :color ,red)))))
|
`(cal-china-x-important-holiday-face ((,class (:underline (:style line :color ,red)))))
|
||||||
`(cal-china-x-general-holiday-face ((,class (:underline (:style line :color ,yellow)))))
|
`(cal-china-x-general-holiday-face ((,class (:underline (:style line :color ,yellow)))))
|
||||||
`(holiday ((,class (:underline (:style line :color ,yellow)))))
|
`(holiday ((,class (:underline (:style line :color ,yellow)))))
|
||||||
|
`(markdown-header-face-1 ((,class (:foreground ,orange :height 1.0 :weight normal))))
|
||||||
|
`(markdown-header-face-2 ((,class (:foreground ,blue :height 1.0 :weight normal))))
|
||||||
|
`(markdown-header-face-3 ((,class (:foreground ,green :height 1.0 :weight normal))))
|
||||||
|
`(markdown-header-face-4 ((,class (:foreground ,yellow :height 1.0 :weight normal))))
|
||||||
|
`(markdown-header-face-5 ((,class (:foreground ,cyan :height 1.0 :weight normal))))
|
||||||
|
`(markdown-header-face-6 ((,class (:foreground ,green :height 1.0 :weight normal))))
|
||||||
|
`(markdown-code-face ((,class (:foreground ,base0))))
|
||||||
|
`(markdown-table-face ((,class (:foreground ,green))))
|
||||||
`(font-lock-keyword-face ((,class (:foreground ,cyan :weight bold))))
|
`(font-lock-keyword-face ((,class (:foreground ,cyan :weight bold))))
|
||||||
`(font-lock-doc-face ((,class (:foreground ,green :slant normal))))
|
`(font-lock-doc-face ((,class (:foreground ,green :slant normal))))
|
||||||
`(font-lock-string-face ((,class (:foreground ,green))))
|
`(font-lock-string-face ((,class (:foreground ,green))))
|
||||||
|
|||||||
Reference in New Issue
Block a user