如何在 emacs 中設定全域組織發布匯出設定

如何在 emacs 中設定全域組織發布匯出設定

作為這個問題的後續:超級用戶問題 431356

如何全域指定組織模式發佈設定?那麼不是針對每個項目,而是針對我碰巧發布的任何 .org 文件?

所以而不是:

 (setq org-publish-project-alist
  '(("Homepage"
  :base-directory "~/git/homepage/"
  :base-extension "org"
  :publishing-directory "~/public_html/"
  :publishing-function org-publish-org-to-html
  :style "<link rel=\"stylesheet\" href=\"style.css\" type=\"text/css\" />")))

或對於每個文件:

 #+STYLE: <link rel="stylesheet" type="text/css" href="stylesheet.css" />

我想要一些可以更改任何組織文件預設值的東西。

答案1

您可以自訂org-export-html-styleorg-export-html-style-extra.

第一個具有組織導出的所有預設值,因此您最好保持原樣,除非您想覆蓋所有內容。

org-export-html-style-extra在預設樣式定義之後附加您自己的變體。

我使用這個設定:

"<style type=\"text/css\">\n  html {\n  font-family: sans-serif;\n  font-size: 11pt;\n  }\n  em { font-style: normal; font-weight: bold;}\n</style>"

答案2

Juancho 的答案對我有用,但有一個變化:在瀏覽組織模式自訂功能表(自訂 > 匯出 > HTML > 樣式附加)時,我必須刪除 \n 和轉義字元。

相關內容