2012-07-19 64 views
2

我想使用在~/.emacs中定義的elisp defun自動執行兩個組織模式文件的html導出。我寫了下面的代碼:通過elisp自動執行組織模式html導出

(defun publish-custom-orgs() 
    "publish certain org files as html files" 
    (interactive) 
    (find-file "~/org/a.org") 
    (org-export-as-html) 
    (find-file "~/org/b.org") 
    (org-export-as-html) 
) 

但是這不會導出文件;相反,它顯示在迷你一個奇怪的輸出:

enter image description here

我在做什麼錯?

回答

2

您可以嘗試組織 - 出口爲HTML的批次

(defun publish-custom-orgs() 
    "publish certain org files as html files" 
    (interactive) 
    (find-file "~/org/a.org") 
    (org-export-as-html-batch) 
    (find-file "~/org/b.org") 
    (org-export-as-html-batch) 
) 
+0

謝謝!洞悉爲什麼'org-export'不起作用? – 2012-07-19 11:51:25

+1

org-export-as-html需要至少一個參數。 '(org-export-as-html org-export-headline-levels)'或'(org-export-as-html 3)''一定是好的。 [git中的代碼行](http://orgmode.org/w/?p=org-mode.git;a=blob;f=lisp/org-html.el;h=a2cf2c763edc4d8ac83ad7e84128ec4a67d24b17;hb=HEAD#l1099) – slitvinov 2012-07-19 12:52:12

相關問題