>From 01640c5a9f0d4957a0289a9dfc0497f5b7d42bd9 Mon Sep 17 00:00:00 2001 From: Rick Frankel
Date: Fri, 8 Mar 2013 19:00:21 -0500 Subject: [PATCH] Parameterize some html content containers * lisp/ox-html.el: (define-backend): Add :html-doctype and :html-container parameters. (org-html-doctype): New customization variable for doctype declaration. (org-html-container-elemnt): New customization variable for specifying wrapper container element. (org-html-div): Change to list of pairs id, element type to allow setting container element. (org-html--build-preamble): Modified to use new org-html-div settings. (org-html--build-postamble): Modified to use new org-html-div settings. (org-html-template): Modified to use doctype and container-element settings. --- lisp/ox-html.el | 76 ++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 57 insertions(+), 19 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 829fe28..a971440 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -113,6 +113,8 @@ (org-open-file (org-html-export-to-html nil s v b))))))) :options-alist ((:html-extension nil nil org-html-extension) + (:html-doctype "HTML_DOCTYPE" nil org-html-doctype) + (:html-container "HTML_CONTAINER" nil org-html-container-element) (:html-link-home "HTML_LINK_HOME" nil org-html-link-home) (:html-link-up "HTML_LINK_UP" nil org-html-link-up) (:html-mathjax "HTML_MATHJAX" nil "" space) @@ -859,19 +861,44 @@ Use utf-8 as the default value." :package-version '(Org . "8.0") :type 'coding-system) -(defcustom org-html-divs '("preamble" "content" "postamble") - "The name of the main divs for HTML export. -This is a list of three strings, the first one for the preamble -DIV, the second one for the content DIV and the third one for the -postamble DIV." +(defcustom org-html-doctype + "" + "Document type definition to use for exported HTML files. +Can be set with the in-buffer HTML_DOCTYPE property or for +publishing, with :html-doctype." :group 'org-export-html :version "24.4" :package-version '(Org . "8.0") - :type '(list - (string :tag " Div for the preamble:") - (string :tag " Div for the content:") - (string :tag "Div for the postamble:"))) + :type 'string) + +(defcustom org-html-container-element "div" + "Container class to use for wrapping top level sections in +the exported html file. Can be set with the in-buffer HTML_CONTAINER +property or for publishing, with :html-container" + :group 'org-export-html + :version "24.4" + :package-version '(Org . "8.0") + :type 'string) +(defcustom org-html-divs + '(("preamble" "div") + ("content" "div") + ("postamble" "div")) + "Alist of the main divs for HTML export. +This is a list of three pairs, ID and ELEMENT, the first one +for the preamble, the second one for the content and the +third one for the postamble." + :group 'org-export-html + :version "24.4" + :package-version '(Org . "8.0") + :type '(list + (list :tag "Preamble" + (string :tag " id") (string :tag "element")) + (list :tag "Content" + (string :tag " id") (string :tag "element")) + (list :tag "Postamble" + (string :tag " id") (string :tag "element")))) ;;;; Template :: Mathjax @@ -1482,9 +1509,11 @@ INFO is a plist used as a communication channel." `((?t . ,title) (?a . ,author) (?d . ,date) (?e . ,email)))))))) (when (org-string-nw-p preamble-contents) - (concat (format "