-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.el
37 lines (32 loc) · 1.24 KB
/
init.el
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
;; init.el --- Description -*- lexical-binding: t; -*-
(require 'org)
(require 'json)
(setq org-html-head ""
org-html-head-extra ""
org-html-head-include-default-style nil
org-html-head-include-scripts nil
org-html-preamble nil
org-html-postamble nil
org-html-use-infojs nil
org-export-body-only t
org-export-with-toc nil
org-export-with-latex t
org-html-html5-fancy t
org-html-toplevel-hlevel 2
org-export-with-section-numbers nil
org-export-headline-levels 6)
(defun org->html-to-stdout (file)
(save-window-excursion
(find-file file)
(let* ((keywords '("title" "category" "tags" "email" "language" "author"))
(kvs (org-collect-keywords keywords)))
(princ (json-encode (append
(mapcar (lambda (kv)
(cons (downcase (car kv))
(cadr kv)))
kvs)
`((content .
,(progn
(org-html-export-as-html nil nil nil t)
(buffer-string))))))))))
(org->html-to-stdout "./blogs/demo.org")