在org-mode中,是否有将(当前)子树导出为HTML的函数?如何做到这一点?
在org-mode中,可以使用以下命令将当前子树导出为HTML:`C-c C-e H s`。
在org-mode中,可以使用以下命令将当前子树导出为HTML:`C-c C-e H s`。
使用 Org 8:
M-x org-export-dispatch
C-s (change the export scope to subtree)
h (HTML menu)
h (export to HTML file)
你还可以使用org-narrow-to-subtree
来缩小缓冲区并运行正常导出。
C-x n s
,返回到扩展视图则是 C-x n w
。感谢您的提示! - Dox该函数是org-html-export-to-html
,可以使用参数nil t
调用以导出当前子树。
(defun subtree-html ()
(interactive)
(org-html-export-to-html nil t))
你也可以创建宏(然后由函数执行)。
步骤:
C-x(
https://www.gnu.org/software/emacs/manual/html_node/emacs/Basic-Keyboard-Macro.html#Basic-Keyboard-MacroM-x org-export-dispatch C-s h h
)C-x e
kmacro-name-last-macro
保存(不是name-last-kbd-macro
)M-x insert-kbd-macro
插入到文件中setq last-kbd-macro
替换为execute-kbd-macro
(defun subtree-html () (interactive) (execute-kbd-macro _____))
其中_____
是insert-kbd-macro
的输出。
(org-html-export-to-html nil t)
分配给任何一个函数。创建一个明确的命令,或者将上述内容包装在(lambda ...)
表达式中(参见匿名函数)。 - fniessen