Simplfiy setting S5 slideshow type to XOXO.

* contrib/lisp/ox-s5.el (org-s5-template): Set org-html-divs based on
  :html-container. If it's "li", use XOXO format ("ol").
(org-s5-divs): Changed to internal variable from option and renamed to
`org--s5--divs' -- Changing the element type or id of the
preamble (header) or postamble (footer) breaks the S5 stylesheets.
This commit is contained in:
Rick Frankel 2013-03-17 12:07:26 -04:00
parent 91a6caa6a2
commit 77e6543f8a
1 changed files with 15 additions and 22 deletions

View File

@ -118,31 +118,21 @@ Can be overriden with the S5_UI_URL property."
:group 'org-export-s5 :group 'org-export-s5
:type '(choice (const hidden) (const visibile))) :type '(choice (const hidden) (const visibile)))
(defcustom org-s5-divs (defvar org-s5--divs
'((preamble "div" "header") '((preamble "div" "header")
(content "div" "content") (content "div" "content")
(postamble "div" "footer")) (postamble "div" "footer"))
"Alist of the threed section elements for HTML export. "Alist of the three section elements for HTML export.
The car of each entry is one of 'preamble, 'content or 'postamble. The car of each entry is one of 'preamble, 'content or 'postamble.
The cdrs of each entry are the ELEMENT_TYPE and ID for each The cdrs of each entry are the ELEMENT_TYPE and ID for each
section of the exported document. section of the exported document.
Note that changing the defaults for the preamble and postamble If you set `org-html-container-element' to \"li\", \"ol\" will be
will break the standard S5 stylesheets. To generate XOXO compatible uses as the content ELEMENT_TYPE, generating an XOXO format
slideshows, change the content ELEMENT_TYPE to \"ul\" or \"ol\" slideshow.
and the `org-html-container-element' to \"li\"."
:group 'org-export-html Note that changing the preamble or postamble will break the
:version "24.4" core S5 stylesheets.")
:package-version '(Org . "8.0")
:type '(list :greedy t
(list :tag "Preamble"
(const :format "" preamble)
(string :tag "element") (string :tag " id"))
(list :tag "Content"
(const :format "" content)
(string :tag "element") (string :tag " id"))
(list :tag "Postamble" (const :format "" postamble)
(string :tag " id") (string :tag "element"))))
(defcustom org-s5-postamble "<h1>%a - %t</h1>" (defcustom org-s5-postamble "<h1>%a - %t</h1>"
"Preamble inserted into the S5 layout section. "Preamble inserted into the S5 layout section.
@ -306,7 +296,10 @@ holding export options."
"Return complete document string after HTML conversion. "Return complete document string after HTML conversion.
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."
(let ((org-html-divs org-s5-divs) (let ((org-html-divs
(if (equal (plist-get info :html-container) "li")
(append '((content "ol" "content")) org-s5--divs)
org-s5--divs))
(info (plist-put (info (plist-put
(plist-put info :html-preamble (plist-get info :s5-preamble)) (plist-put info :html-preamble (plist-get info :s5-preamble))
:html-postamble (plist-get info :s5-postamble)))) :html-postamble (plist-get info :s5-postamble))))
@ -330,8 +323,8 @@ holding export options."
(org-html--build-pre/postamble 'postamble info) (org-html--build-pre/postamble 'postamble info)
"</div>" "</div>"
(format "<%s id=\"%s\" class=\"presentation\">" (format "<%s id=\"%s\" class=\"presentation\">"
(nth 1 (assq 'content org-s5-divs)) (nth 1 (assq 'content org-html-divs))
(nth 2 (assq 'content org-s5-divs))) (nth 2 (assq 'content org-html-divs)))
;; title page ;; title page
(format "<%s id='title-slide' class='slide'>" (format "<%s id='title-slide' class='slide'>"
(plist-get info :html-container)) (plist-get info :html-container))
@ -341,7 +334,7 @@ holding export options."
(let ((depth (plist-get info :with-toc))) (let ((depth (plist-get info :with-toc)))
(when depth (org-s5-toc depth info))) (when depth (org-s5-toc depth info)))
contents contents
(format "</%s>" (nth 1 (assq 'content org-s5-divs))) (format "</%s>" (nth 1 (assq 'content org-html-divs)))
"</body>" "</body>"
"</html>\n") "\n"))) "</html>\n") "\n")))