-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexport.el
28 lines (22 loc) · 862 Bytes
/
export.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
(require 'package)
(require 'org)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(package-initialize)
(package-refresh-contents)
(package-install 'f)
(message "Emacs directory: %s" user-emacs-directory)
(require 'f)
(require 'ox-md)
(require 'ox-publish)
(setq org-confirm-babel-evaluate nil
org-html-validation-link nil
org-html-table-default-attributes '(:border "2" :cellspacing "0" :cellpadding "6" :rules "groups" :frame "void")
make-backup-files nil)
(defvar project-root
(file-name-as-directory (expand-file-name "docs" default-directory)))
(dolist (file (f-files project-root (lambda (file) (f-ext-p file "org")) t))
(message "Exporting %s" (f-relative file))
(with-temp-buffer
(find-file file)
(org-export-to-file 'md (concat (f-no-ext file) ".md"))))
(message "Project generated!")