Bladeren bron

ox-html.el: Fix document structure for org-info.js compatibility.

* ox-html.el (org-html-inner-template): Add the document title
here, within the "content" class, as the org-info.js needs it.
(org-html-template): Don't include the document's title here.
(org-html-format-inlinetask-function): Remove wrong example.

Although counter-intuitive and certainly weird, the
<h1 class="title"> string needs to be within the "content"
div, not before it.  We would need the developer of org-info.js
to update org-info.js to put the title outside of "content".
Bastien Guerry 12 jaren geleden
bovenliggende
commit
cfe1d9a9fc
1 gewijzigde bestanden met toevoegingen van 5 en 27 verwijderingen
  1. 5 27
      lisp/ox-html.el

+ 5 - 27
lisp/ox-html.el

@@ -388,29 +388,7 @@ The function must accept six parameters:
   TAGS      the inlinetask tags, as a list of strings.
   CONTENTS  the contents of the inlinetask, as a string.
 
-The function should return the string to be exported.
-
-For example, the variable could be set to the following function
-in order to mimic default behaviour:
-
-\(defun org-html-format-inlinetask \(todo type priority name tags contents\)
-\"Format an inline task element for HTML export.\"
-  \(let \(\(full-title
-	 \(concat
-	  \(when todo
-            \(format \"\\\\textbf{\\\\textsf{\\\\textsc{%s}}} \" todo))
-	  \(when priority (format \"\\\\framebox{\\\\#%c} \" priority))
-	  title
-	  \(when tags (format \"\\\\hfill{}\\\\textsc{%s}\" tags)))))
-    \(format (concat \"\\\\begin{center}\\n\"
-		    \"\\\\fbox{\\n\"
-		    \"\\\\begin{minipage}[c]{.6\\\\textwidth}\\n\"
-		    \"%s\\n\\n\"
-		    \"\\\\rule[.8em]{\\\\textwidth}{2pt}\\n\\n\"
-		    \"%s\"
-		    \"\\\\end{minipage}}\"
-		    \"\\\\end{center}\")
-	    full-title contents))"
+The function should return the string to be exported."
   :group 'org-export-html
   :type 'function)
 
@@ -1323,6 +1301,10 @@ CONTENTS is the transcoded contents string.  INFO is a plist
 holding export options."
   (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.
    (let ((depth (plist-get info :with-toc)))
      (when depth (org-html-toc depth info)))
@@ -1370,10 +1352,6 @@ holding export options."
 	       (or link-home link-up))))
    ;; Preamble.
    (org-html--build-preamble info)
-   ;; Document title.
-   (let ((title (plist-get info :title)))
-     (when title
-       (format "<h1 class=\"title\">%s</h1>\n" (org-export-data title info))))
    ;; Document contents.
    contents
    ;; Postamble.