通过批处理导出时,如何将安装文件视为安全?

问题描述 投票:0回答:1

在我的

org-mode
文件中,我有一个源单元格,其中包含我想要将此文件导出到的各种格式。

#+title: How to export this document?
#+author: me
#+SETUPFILE: https://fniessen.github.io/org-html-themes/org/theme-readtheorg.setup

* Export feature
#+BEGIN_SRC sh :exports code :results none :var filename=(buffer-name)
emacs -Q "$filename" --batch -f org-html-export-to-html --kill
emacs -Q "$filename" --batch -f org-ascii-export-to-ascii --kill
emacs -Q "$filename" --batch -f org-latex-export-to-pdf --kill
#+END_SRC

当我执行单元格时,出现错误:

The remote resource "https://fniessen.github.io/org-html-themes/org/theme-readtheorg.setup" is considered unsafe, and will not be downloaded.
导出为 html 现在是普通导出。

如何使用设置文件将文件导出为 html?

org-mode
1个回答
0
投票

我通过创建包含以下内容的 .export.el 文件来解决这个问题:

(setq org-safe-remote-resources '("https://raw.githubusercontent.com/fniessen/org-html-themes/master/org/theme-readtheorg.setup"))
(find-file "README.org")
(org-html-export-to-html)

然后运行批处理模式就会成功:

emacs --batch --eval '(load-file ".export.el")' 
© www.soinside.com 2019 - 2024. All rights reserved.