diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 5e55391..a8989f2 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -103,14 +103,6 @@
:export-block "HTML"
:filters-alist ((:filter-options . org-html-infojs-install-script)
(:filter-final-output . org-html-final-function))
- :menu-entry
- (?h "Export to HTML"
- ((?H "As HTML buffer" org-html-export-as-html)
- (?h "As HTML file" org-html-export-to-html)
- (?o "As HTML file and open"
- (lambda (a s v b)
- (if a (org-html-export-to-html t s v b)
- (org-open-file (org-html-export-to-html nil s v b)))))))
:options-alist
((:html-extension nil nil org-html-extension)
(:html-link-home "HTML_LINK_HOME" nil org-html-link-home)
@@ -129,6 +121,18 @@
;; Leave room for "ox-infojs.el" extension.
(:infojs-opt "INFOJS_OPT" nil nil)))
+(org-export-define-derived-backend HTML html
+ :menu-entry
+ (?h "Export to HTML"
+ ((?H "As HTML buffer" org-html-export-as-html)
+ (?h "As HTML file" org-html-export-to-html)
+ (?o "As HTML file and open"
+ (lambda (a s v b)
+ (if a (org-html-export-to-html t s v b)
+ (org-open-file (org-html-export-to-html nil s v b)))))))
+ :translate-alist ((headline . org-HTML-headline)
+ (section . org-HTML-section)))
+
;;; Internal Variables
@@ -2153,31 +2157,70 @@ holding contextual information."
(extra-class (org-element-property :HTML_CONTAINER_CLASS headline))
(level1 (+ level (1- org-html-toplevel-hlevel)))
(first-content (car (org-element-contents headline))))
- (format "
%s%s
\n"
+ (concat
+ (format "\n%s%s\n"
+ level1
+ preferred-id
+ (mapconcat
+ (lambda (x)
+ (let ((id (org-export-solidify-link-text
+ (if (org-uuidgen-p x) (concat "ID-" x)
+ x))))
+ (org-html--anchor id)))
+ extra-ids "")
+ full-text
+ level1)
+ ;; When there is no section, pretend there is an empty
+ ;; one to get the correct %s
\n"
(format "outline-container-%s"
(or (org-element-property :CUSTOM_ID headline)
section-number))
(concat (format "outline-%d" level1) (and extra-class " ")
extra-class)
- (format "\n%s%s\n"
- level1
- preferred-id
- (mapconcat
- (lambda (x)
- (let ((id (org-export-solidify-link-text
- (if (org-uuidgen-p x) (concat "ID-" x)
- x))))
- (org-html--anchor id)))
- extra-ids "")
- full-text
- level1)
- ;; When there is no section, pretend there is an empty
- ;; one to get the correct \n%s
"
class-num
(or (org-element-property :CUSTOM_ID parent) section-number)
@@ -3174,10 +3234,10 @@ is non-nil."
(insert output)
(goto-char (point-min))
(set-auto-mode t)
- (org-export-add-to-stack (current-buffer) 'html)))
- `(org-export-as 'html ,subtreep ,visible-only ,body-only ',ext-plist))
+ (org-export-add-to-stack (current-buffer) 'HTML)))
+ `(org-export-as 'HTML ,subtreep ,visible-only ,body-only ',ext-plist))
(let ((outbuf (org-export-to-buffer
- 'html "*Org HTML Export*"
+ 'HTML "*Org HTML Export*"
subtreep visible-only body-only ext-plist)))
;; Set major mode.
(with-current-buffer outbuf (set-auto-mode t))
@@ -3219,14 +3279,14 @@ Return output file's name."
(org-export-coding-system org-html-coding-system))
(if async
(org-export-async-start
- (lambda (f) (org-export-add-to-stack f 'html))
+ (lambda (f) (org-export-add-to-stack f 'HTML))
(let ((org-export-coding-system org-html-coding-system))
`(expand-file-name
(org-export-to-file
- 'html ,file ,subtreep ,visible-only ,body-only ',ext-plist))))
+ 'HTML ,file ,subtreep ,visible-only ,body-only ',ext-plist))))
(let ((org-export-coding-system org-html-coding-system))
(org-export-to-file
- 'html file subtreep visible-only body-only ext-plist)))))
+ 'HTML file subtreep visible-only body-only ext-plist)))))
;;;###autoload
(defun org-html-publish-to-html (plist filename pub-dir)
@@ -3237,7 +3297,7 @@ is the property list for the given project. PUB-DIR is the
publishing directory.
Return output file name."
- (org-publish-org-to 'html filename ".html" plist pub-dir))
+ (org-publish-org-to 'HTML filename ".html" plist pub-dir))