~abcdw/rde

rde/rde/features/markup.scm -rw-r--r-- 1.4 KiB
e98d6a8eAndrew Tropin rde: gnupg: Add copyright preamble. 19 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
(define-module (rde features markup)
  #:use-module (rde features)
  #:use-module (rde features emacs)
  #:use-module (rde features predicates)
  #:use-module (gnu services)
  #:use-module (gnu home services)
  #:use-module (gnu packages markup)
  #:use-module (gnu packages haskell-xyz)
  #:use-module (gnu packages emacs-xyz)
  #:use-module (guix gexp)

  #:export (feature-markdown))

(define* (feature-markdown
          #:key
          (emacs-markdown-mode emacs-markdown-mode))
  (define emacs-f-name 'markdown)
  (define f-name emacs-f-name)

  (define (get-home-services config)
    (let ((pandoc (get-value 'pandoc config pandoc)))
      (list
       (rde-elisp-configuration-service
        emacs-f-name
        config
        `(;; The package updates auto-mode-list automatically via autoloads
          (with-eval-after-load
           'markdown-mode
           ;; TODO: Package js/css for prettier previews
           (setq markdown-command ,(file-append pandoc "/bin/pandoc"))
           (setq markdown-fontify-code-blocks-natively t)))
        #:summary "\
Markdown tweaks"
        #:commentary "\
Integration with pandoc, better code blocks rendering."
        #:keywords '(convenience)
        #:elisp-packages (list emacs-markdown-mode)))))

  (feature
   (name f-name)
   (values (make-feature-values emacs-markdown-mode))
   (home-services-getter get-home-services)))