;; hans example derived exporter
(require 'ox-html)
(org-export-define-derived-backend
'hans 'html
:menu-entry
'(?j "Export w/ HTML-derived hans exporter"
((?h "To temporary buffer (wurst)" org-hans-export-as-wurst)
(?H "To temporary buffer (bratwurst)" org-hans-export-as-bratwurst)))
:options-alist
'((:hans-option "HANS_OPTION" nil nil t)))
(defun org-hans-export-as-wurst (&optional a subtreep v b ext-plist)
(interactive)
(let* ((doc-env (org-export-get-environment 'hans subtreep ext-plist)))
(message "HANS-OPTION: %s"
(org-element-interpret-data
(plist-get doc-env :hans-option)))
(message "EXPORT-HANS-OPTION: %s"
(org-element-interpret-data
(plist-get doc-env :export-hans-option)))))
(defun org-hans-export-as-bratwurst (&optional a subtreep v b ext-plist)
(interactive)
(save-excursion
(save-restriction
(when subtreep
(org-narrow-to-subtree)
(goto-char (point-min))
(forward-line)
(narrow-to-region (point) (point-max)))
(let* ((doc-env (org-export-get-environment 'hans subtreep ext-plist)))
(message "HANS-OPTION: %s"
(org-element-interpret-data
(plist-get doc-env :hans-option)))
(message "EXPORT-HANS-OPTION: %s"
(org-element-interpret-data
(plist-get doc-env :export-hans-option)))))))
(provide 'ox-hans)