In org-mode, is there a function to export (current) subtree to HTML? How would one go about doing this?
In org-mode, is there a function to export (current) subtree to HTML? How would one go about doing this?
The function is org-html-export-to-html which can be called with arguments nil t to export the current subtree.
(defun subtree-html ()
(interactive)
(org-html-export-to-html nil t))
You can also create macro (which may then be executed by a function).
Steps:
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 ekmacro-name-last-macro (not name-last-kbd-macro)M-x insert-kbd-macrosetq last-kbd-macro with execute-kbd-macro(defun subtree-html () (interactive) (execute-kbd-macro _____)) where _____ is the output of insert-kbd-macro.If there is a less convoluted way to do this that doesn't impact visibility/narrowing (or can easily restore it), I'm curious to hear it.