浏览代码

ox-html: Exclude contents div and title from body-only export

* lisp/ox-html.el (org-html-inner-template): Remove contents div and
  title.
(org-html-template): Add contents div and title.
Nicolas Goaziou 12 年之前
父节点
当前提交
51ab145e36
共有 1 个文件被更改,包括 7 次插入7 次删除
  1. 7 7
      lisp/ox-html.el

+ 7 - 7
lisp/ox-html.el

@@ -1495,11 +1495,6 @@ INFO is a plist used as a communication channel."
 CONTENTS is the transcoded contents string.  INFO is a plist
 CONTENTS is the transcoded contents string.  INFO is a plist
 holding export options."
 holding export options."
   (concat
   (concat
-   (format "<div id=\"%s\">\n" (nth 1 org-html-divs))
-   ;; Document title.
-   (let ((title (plist-get info :title)))
-     (when title
-       (format "<h1 class=\"title\">%s</h1>\n" (org-export-data title info))))
    ;; Table of contents.
    ;; Table of contents.
    (let ((depth (plist-get info :with-toc)))
    (let ((depth (plist-get info :with-toc)))
      (when depth (org-html-toc depth info)))
      (when depth (org-html-toc depth info)))
@@ -1508,8 +1503,7 @@ holding export options."
    ;; Footnotes section.
    ;; Footnotes section.
    (org-html-footnote-section info)
    (org-html-footnote-section info)
    ;; Bibliography.
    ;; Bibliography.
-   (org-html-bibliography)
-   "\n</div>"))
+   (org-html-bibliography)))
 
 
 (defun org-html-template (contents info)
 (defun org-html-template (contents info)
   "Return complete document string after HTML conversion.
   "Return complete document string after HTML conversion.
@@ -1548,7 +1542,13 @@ holding export options."
    ;; Preamble.
    ;; Preamble.
    (org-html--build-preamble info)
    (org-html--build-preamble info)
    ;; Document contents.
    ;; Document contents.
+   (format "<div id=\"%s\">\n" (nth 1 org-html-divs))
+   ;; Document title.
+   (let ((title (plist-get info :title)))
+     (when title
+       (format "<h1 class=\"title\">%s</h1>\n" (org-export-data title info))))
    contents
    contents
+   "</div>\n"
    ;; Postamble.
    ;; Postamble.
    (org-html--build-postamble info)
    (org-html--build-postamble info)
    ;; Closing document.
    ;; Closing document.