From 77e6543f8a2fcd98c8467443966a0f415f3758a9 Mon Sep 17 00:00:00 2001 From: Rick Frankel Date: Sun, 17 Mar 2013 12:07:26 -0400 Subject: [PATCH] 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. --- contrib/lisp/ox-s5.el | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/contrib/lisp/ox-s5.el b/contrib/lisp/ox-s5.el index 76f5fa682..ae7e6bed2 100644 --- a/contrib/lisp/ox-s5.el +++ b/contrib/lisp/ox-s5.el @@ -118,31 +118,21 @@ Can be overriden with the S5_UI_URL property." :group 'org-export-s5 :type '(choice (const hidden) (const visibile))) -(defcustom org-s5-divs +(defvar org-s5--divs '((preamble "div" "header") (content "div" "content") (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 cdrs of each entry are the ELEMENT_TYPE and ID for each section of the exported document. -Note that changing the defaults for the preamble and postamble -will break the standard S5 stylesheets. To generate XOXO compatible -slideshows, change the content ELEMENT_TYPE to \"ul\" or \"ol\" -and the `org-html-container-element' to \"li\"." - :group 'org-export-html - :version "24.4" - :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")))) +If you set `org-html-container-element' to \"li\", \"ol\" will be +uses as the content ELEMENT_TYPE, generating an XOXO format +slideshow. + +Note that changing the preamble or postamble will break the +core S5 stylesheets.") (defcustom org-s5-postamble "

%a - %t

" "Preamble inserted into the S5 layout section. @@ -306,7 +296,10 @@ holding export options." "Return complete document string after HTML conversion. CONTENTS is the transcoded contents string. INFO is a plist 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 (plist-put info :html-preamble (plist-get info :s5-preamble)) :html-postamble (plist-get info :s5-postamble)))) @@ -330,8 +323,8 @@ holding export options." (org-html--build-pre/postamble 'postamble info) "" (format "<%s id=\"%s\" class=\"presentation\">" - (nth 1 (assq 'content org-s5-divs)) - (nth 2 (assq 'content org-s5-divs))) + (nth 1 (assq 'content org-html-divs)) + (nth 2 (assq 'content org-html-divs))) ;; title page (format "<%s id='title-slide' class='slide'>" (plist-get info :html-container)) @@ -341,7 +334,7 @@ holding export options." (let ((depth (plist-get info :with-toc))) (when depth (org-s5-toc depth info))) contents - (format "" (nth 1 (assq 'content org-s5-divs))) + (format "" (nth 1 (assq 'content org-html-divs))) "" "\n") "\n")))