|
@@ -56,21 +56,22 @@
|
|
|
((?H "To temporary buffer" org-s5-export-as-html)
|
|
|
(?h "To file" org-s5-export-to-html)
|
|
|
(?o "To file and open"
|
|
|
- (lambda (a s v b)
|
|
|
- (if a (org-s5-export-to-html t s v b)
|
|
|
- (org-open-file (org-s5-export-to-html nil s v b)))))))
|
|
|
+ (lambda (a s v b)
|
|
|
+ (if a (org-s5-export-to-html t s v b)
|
|
|
+ (org-open-file (org-s5-export-to-html nil s v b)))))))
|
|
|
:options-alist
|
|
|
((:html-link-home "HTML_LINK_HOME" nil nil)
|
|
|
(:html-link-up "HTML_LINK_UP" nil nil)
|
|
|
- (:html-postamble nil "html-postamble" nil t)
|
|
|
- (:html-preamble nil "html-preamble" nil t)
|
|
|
+ (:s5-postamble "S5_POSTAMBLE" nil org-s5-postamble newline)
|
|
|
+ (:s5-preamble "S5_PREAMBLE" nil org-s5-preamble newline)
|
|
|
(:html-head-include-default-style "HTML_INCLUDE_DEFAULT_STYLE" nil nil)
|
|
|
(:html-head-include-scripts "HTML_INCLUDE_SCRIPTS" nil nil)
|
|
|
(:s5-version "S5_VERSION" nil org-s5-version)
|
|
|
(:s5-theme-file "S5_THEME_FILE" nil org-s5-theme-file)
|
|
|
(:s5-ui-url "S5_UI_URL" nil org-s5-ui-url)
|
|
|
(:s5-default-view "S5_DEFAULT_VIEW" nil org-s5-default-view)
|
|
|
- (:s5-control-visibility "S5_CONTROL_VISIBILITY" nil org-s5-control-visibility))
|
|
|
+ (:s5-control-visibility "S5_CONTROL_VISIBILITY" nil
|
|
|
+ org-s5-control-visibility))
|
|
|
:translate-alist
|
|
|
((headline . org-s5-headline)
|
|
|
(plain-list . org-s5-plain-list)
|
|
@@ -117,97 +118,142 @@ Can be overriden with the S5_UI_URL property."
|
|
|
:group 'org-export-s5
|
|
|
:type '(choice (const hidden) (const visibile)))
|
|
|
|
|
|
-(defcustom org-s5-footer-template
|
|
|
- "<div id=\"footer\">
|
|
|
-<h1>%author - %title</h1>
|
|
|
-</div>"
|
|
|
- "Format template to specify footer div. Completed using
|
|
|
-`org-fill-template'.
|
|
|
-Optional keys include %author, %email, %file, %title and %date.
|
|
|
-Note that the div id must be \"footer\"."
|
|
|
+(defcustom org-s5-divs
|
|
|
+ '((preamble "div" "header")
|
|
|
+ (content "div" "content")
|
|
|
+ (postamble "div" "footer"))
|
|
|
+ "Alist of the threed 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"))))
|
|
|
+
|
|
|
+(defcustom org-s5-postamble "<h1>%a - %t</h1>"
|
|
|
+ "Preamble inserted into the S5 layout section.
|
|
|
+When set to a string, use this string as the postamble.
|
|
|
+
|
|
|
+When set to a function, apply this function and insert the
|
|
|
+returned string. The function takes the property list of export
|
|
|
+options as its only argument.
|
|
|
+
|
|
|
+Setting the S5_POSTAMBLE option -- or the :s5-postamble in publishing
|
|
|
+projects -- will take precedence over this variable.
|
|
|
+
|
|
|
+Note that the default css styling will break if this is set to nil
|
|
|
+or an empty string."
|
|
|
:group 'org-export-s5
|
|
|
- :type 'string)
|
|
|
+ :type '(choice (const :tag "No postamble" " ")
|
|
|
+ (string :tag "Custom formatting string")
|
|
|
+ (function :tag "Function (must return a string)")))
|
|
|
|
|
|
-(defcustom org-s5-header-template "<div id=\"header\"></div>"
|
|
|
- "Format template to specify footer div. Completed using
|
|
|
-`org-fill-template'.
|
|
|
-Optional keys include %author, %email, %file, %title and %date.
|
|
|
-Note that the div id must be \"header\"."
|
|
|
- :group 'org-export-s5
|
|
|
- :type 'string)
|
|
|
+(defcustom org-s5-preamble " "
|
|
|
+ "Peamble inserted into the S5 layout section.
|
|
|
+
|
|
|
+When set to a string, use this string as the preamble.
|
|
|
+
|
|
|
+When set to a function, apply this function and insert the
|
|
|
+returned string. The function takes the property list of export
|
|
|
+options as its only argument.
|
|
|
+
|
|
|
+Setting S5_PREAMBLE option -- or the :s5-preamble in publishing
|
|
|
+projects -- will take precedence over this variable.
|
|
|
|
|
|
-(defcustom org-s5-title-page-template
|
|
|
- "<div class=\"slide title-page\">
|
|
|
-<h1>%title</h1>
|
|
|
-<h1>%author</h1>
|
|
|
-<h1>%email</h1>
|
|
|
-<h1>%date</h1>
|
|
|
-</div>"
|
|
|
- "Format template to specify title page div. Completed using
|
|
|
-`org-fill-template'.
|
|
|
-Optional keys include %author, %email, %file, %title and %date.
|
|
|
-Note that the wrapper div must include the class \"slide\"."
|
|
|
+Note that the default css styling will break if this is set to nil
|
|
|
+or an empty string."
|
|
|
+ :group 'org-export-s5
|
|
|
+ :type '(choice (const :tag "No preamble" " ")
|
|
|
+ (string :tag "Custom formatting string")
|
|
|
+ (function :tag "Function (must return a string)")))
|
|
|
+
|
|
|
+(defcustom org-s5-title-slide-template
|
|
|
+ "<h1>%t</h1>
|
|
|
+<h2>%a</h2>
|
|
|
+<h2>%e</h2>
|
|
|
+<h2>%d</h2>"
|
|
|
+ "Format template to specify title page section.
|
|
|
+See `org-html-postamble-format' for the valid elements which
|
|
|
+can be included.
|
|
|
+
|
|
|
+It will be wrapped in the element defined in the :html-container
|
|
|
+property, and defaults to the value of `org-html-container-element',
|
|
|
+and have the id \"title-slide\"."
|
|
|
:group 'org-export-s5
|
|
|
:type 'string)
|
|
|
|
|
|
-
|
|
|
(defun org-s5--format-toc-headline (headline info)
|
|
|
"Return an appropriate table of contents entry for HEADLINE.
|
|
|
Note that (currently) the S5 exporter does not support deep links,
|
|
|
so the table of contents is not \"active\".
|
|
|
INFO is a plist used as a communication channel."
|
|
|
(let* ((headline-number (org-export-get-headline-number headline info))
|
|
|
- (section-number
|
|
|
- (and (not (org-export-low-level-p headline info))
|
|
|
- (org-export-numbered-headline-p headline info)
|
|
|
- (concat (mapconcat 'number-to-string headline-number ".") ". ")))
|
|
|
- (tags (and (eq (plist-get info :with-tags) t)
|
|
|
- (org-export-get-tags headline info))))
|
|
|
+ (section-number
|
|
|
+ (and (not (org-export-low-level-p headline info))
|
|
|
+ (org-export-numbered-headline-p headline info)
|
|
|
+ (concat (mapconcat 'number-to-string headline-number ".") ". ")))
|
|
|
+ (tags (and (eq (plist-get info :with-tags) t)
|
|
|
+ (org-export-get-tags headline info))))
|
|
|
(concat section-number
|
|
|
- (org-export-data
|
|
|
- (org-export-get-alt-title headline info) info)
|
|
|
- (and tags " ") (org-html--tags tags))))
|
|
|
+ (org-export-data
|
|
|
+ (org-export-get-alt-title headline info) info)
|
|
|
+ (and tags " ") (org-html--tags tags))))
|
|
|
|
|
|
(defun org-s5-toc (depth info)
|
|
|
(let* ((headlines (org-export-collect-headlines info depth))
|
|
|
- (toc-entries
|
|
|
- (mapcar (lambda (headline)
|
|
|
- (cons (org-s5--format-toc-headline headline info)
|
|
|
- (org-export-get-relative-level headline info)))
|
|
|
- (org-export-collect-headlines info depth))))
|
|
|
+ (toc-entries
|
|
|
+ (mapcar (lambda (headline)
|
|
|
+ (cons (org-s5--format-toc-headline headline info)
|
|
|
+ (org-export-get-relative-level headline info)))
|
|
|
+ (org-export-collect-headlines info depth))))
|
|
|
(when toc-entries
|
|
|
(concat
|
|
|
- "<div id=\"table-of-contents\" class=\"slide\">\n"
|
|
|
+ (format "<%s id='table-of-contents' class='slide'>\n"
|
|
|
+ (plist-get info :html-container))
|
|
|
(format "<h1>%s</h1>\n"
|
|
|
- (org-html--translate "Table of Contents" info))
|
|
|
+ (org-html--translate "Table of Contents" info))
|
|
|
"<div id=\"text-table-of-contents\">"
|
|
|
(org-html--toc-text toc-entries)
|
|
|
"</div>\n"
|
|
|
- "</div>\n"))))
|
|
|
+ (format "</%s>\n" (plist-get info :html-container))))))
|
|
|
|
|
|
(defun org-s5--build-head (info)
|
|
|
(let* ((dir (plist-get info :s5-ui-url))
|
|
|
- (theme (or (plist-get info :s5-theme-file) "default/slides.css")))
|
|
|
+ (theme (or (plist-get info :s5-theme-file) "default/slides.css")))
|
|
|
(mapconcat
|
|
|
'identity
|
|
|
(list
|
|
|
"<!-- style sheet links -->"
|
|
|
(mapconcat
|
|
|
(lambda (list)
|
|
|
- (format
|
|
|
- (concat
|
|
|
- "<link rel='stylesheet' href='%s/default/%s' type='text/css'"
|
|
|
- " media='%s' id='%s' />")
|
|
|
- dir (nth 0 list) (nth 1 list) (nth 2 list)))
|
|
|
+ (format
|
|
|
+ (concat
|
|
|
+ "<link rel='stylesheet' href='%s/default/%s' type='text/css'"
|
|
|
+ " media='%s' id='%s' />")
|
|
|
+ dir (nth 0 list) (nth 1 list) (nth 2 list)))
|
|
|
(list
|
|
|
- '("outline.css" "screen" "outlineStyle")
|
|
|
- '("print.css" "print" "slidePrint")
|
|
|
- '("opera.css" "projection" "operaFix")) "\n")
|
|
|
+ '("outline.css" "screen" "outlineStyle")
|
|
|
+ '("print.css" "print" "slidePrint")
|
|
|
+ '("opera.css" "projection" "operaFix")) "\n")
|
|
|
(format (concat
|
|
|
- "<link rel='stylesheet' href='%s' type='text/css'"
|
|
|
- " media='screen' id='slideProj' />")
|
|
|
- (if (string-match-p "^\\(http\\|/\\)" theme) theme
|
|
|
- (concat dir "/" theme)))
|
|
|
+ "<link rel='stylesheet' href='%s' type='text/css'"
|
|
|
+ " media='screen' id='slideProj' />")
|
|
|
+ (if (string-match-p "^\\(http\\|/\\)" theme) theme
|
|
|
+ (concat dir "/" theme)))
|
|
|
"<!-- S5 JS -->"
|
|
|
(concat
|
|
|
"<script src='" dir
|
|
@@ -217,7 +263,7 @@ INFO is a plist used as a communication channel."
|
|
|
(concat
|
|
|
(org-html--build-meta-info info)
|
|
|
(format "<meta name=\"version\" content=\"S5 %s\" />\n"
|
|
|
- (plist-get info :s5-version))
|
|
|
+ (plist-get info :s5-version))
|
|
|
(format "<meta name='defaultView' content='%s' />\n"
|
|
|
(plist-get info :s5-default-view))
|
|
|
(format "<meta name='controlVis' content='%s' />"
|
|
@@ -239,24 +285,16 @@ If a containing headline has the property :INCREMENTAL,
|
|
|
then the \"incremental\" class will be added to the to the list,
|
|
|
which will make the list into a \"build\"."
|
|
|
(let* ((type (org-element-property :type plain-list))
|
|
|
- (tag (case type
|
|
|
- (ordered "ol")
|
|
|
- (unordered "ul")
|
|
|
- (descriptive "dl"))))
|
|
|
+ (tag (case type
|
|
|
+ (ordered "ol")
|
|
|
+ (unordered "ul")
|
|
|
+ (descriptive "dl"))))
|
|
|
(format "%s\n%s%s"
|
|
|
- (format
|
|
|
- "<%s class='org-%s%s'>" tag tag
|
|
|
- (if (org-export-get-node-property :INCREMENTAL plain-list t)
|
|
|
- " incremental" ""))
|
|
|
- contents (org-html-end-plain-list type))))
|
|
|
-
|
|
|
-(defun org-s5-template-alist (info)
|
|
|
- `(
|
|
|
- ("title" . ,(car (plist-get info :title)))
|
|
|
- ("author" . ,(car (plist-get info :author)))
|
|
|
- ("email" . ,(plist-get info :email))
|
|
|
- ("date" . ,(nth 0 (plist-get info :date)))
|
|
|
- ("file" . ,(plist-get info :input-file))))
|
|
|
+ (format
|
|
|
+ "<%s class='org-%s%s'>" tag tag
|
|
|
+ (if (org-export-get-node-property :INCREMENTAL plain-list t)
|
|
|
+ " incremental" ""))
|
|
|
+ contents (org-html-end-plain-list type))))
|
|
|
|
|
|
(defun org-s5-inner-template (contents info)
|
|
|
"Return body of document string after HTML conversion.
|
|
@@ -268,39 +306,44 @@ holding export options."
|
|
|
"Return complete document string after HTML conversion.
|
|
|
CONTENTS is the transcoded contents string. INFO is a plist
|
|
|
holding export options."
|
|
|
- (mapconcat
|
|
|
- 'identity
|
|
|
- (list
|
|
|
- "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
|
|
|
- \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"
|
|
|
- (format "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"%s\" xml:lang=\"%s\">"
|
|
|
- (plist-get info :language) (plist-get info :language))
|
|
|
- "<head>"
|
|
|
- (org-s5--build-meta-info info)
|
|
|
- (org-s5--build-head info)
|
|
|
- (org-html--build-head info)
|
|
|
- (org-html--build-mathjax-config info)
|
|
|
- "</head>"
|
|
|
- "<body>"
|
|
|
- "<div class=\"layout\">"
|
|
|
- "<div id=\"controls\"><!-- no edit --></div>"
|
|
|
- "<div id=\"currentSlide\"><!-- no edit --></div>"
|
|
|
- (org-fill-template
|
|
|
- org-s5-header-template (org-s5-template-alist info))
|
|
|
- (org-fill-template
|
|
|
- org-s5-footer-template (org-s5-template-alist info))
|
|
|
- "</div>"
|
|
|
- (format "<div id=\"%s\" class=\"presentation\">" (nth 1 org-html-divs))
|
|
|
- ;; title page
|
|
|
- (org-fill-template
|
|
|
- org-s5-title-page-template (org-s5-template-alist info))
|
|
|
- ;; table of contents.
|
|
|
- (let ((depth (plist-get info :with-toc)))
|
|
|
- (when depth (org-s5-toc depth info)))
|
|
|
- contents
|
|
|
- "</div>"
|
|
|
- "</body>"
|
|
|
- "</html>\n") "\n"))
|
|
|
+ (let ((org-html-divs org-s5-divs)
|
|
|
+ (info (plist-put
|
|
|
+ (plist-put info :html-preamble (plist-get info :s5-preamble))
|
|
|
+ :html-postamble (plist-get info :s5-postamble))))
|
|
|
+ (mapconcat
|
|
|
+ 'identity
|
|
|
+ (list
|
|
|
+ (plist-get info :html-doctype)
|
|
|
+ (format "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"%s\" xml:lang=\"%s\">"
|
|
|
+ (plist-get info :language) (plist-get info :language))
|
|
|
+ "<head>"
|
|
|
+ (org-s5--build-meta-info info)
|
|
|
+ (org-s5--build-head info)
|
|
|
+ (org-html--build-head info)
|
|
|
+ (org-html--build-mathjax-config info)
|
|
|
+ "</head>"
|
|
|
+ "<body>"
|
|
|
+ "<div class=\"layout\">"
|
|
|
+ "<div id=\"controls\"><!-- no edit --></div>"
|
|
|
+ "<div id=\"currentSlide\"><!-- no edit --></div>"
|
|
|
+ (org-html--build-pre/postamble 'preamble info)
|
|
|
+ (org-html--build-pre/postamble 'postamble info)
|
|
|
+ "</div>"
|
|
|
+ (format "<%s id=\"%s\" class=\"presentation\">"
|
|
|
+ (nth 1 (assq 'content org-s5-divs))
|
|
|
+ (nth 2 (assq 'content org-s5-divs)))
|
|
|
+ ;; title page
|
|
|
+ (format "<%s id='title-slide' class='slide'>"
|
|
|
+ (plist-get info :html-container))
|
|
|
+ (format-spec org-s5-title-slide-template (org-html-format-spec info))
|
|
|
+ (format "</%s>" (plist-get info :html-container))
|
|
|
+ ;; table of contents.
|
|
|
+ (let ((depth (plist-get info :with-toc)))
|
|
|
+ (when depth (org-s5-toc depth info)))
|
|
|
+ contents
|
|
|
+ (format "</%s>" (nth 1 (assq 'content org-s5-divs)))
|
|
|
+ "</body>"
|
|
|
+ "</html>\n") "\n")))
|
|
|
|
|
|
(defun org-s5-export-as-html
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
|
@@ -335,21 +378,21 @@ is non-nil."
|
|
|
(interactive)
|
|
|
(if async
|
|
|
(org-export-async-start
|
|
|
- (lambda (output)
|
|
|
- (with-current-buffer (get-buffer-create "*Org S5 Export*")
|
|
|
- (erase-buffer)
|
|
|
- (insert output)
|
|
|
- (goto-char (point-min))
|
|
|
- (nxml-mode)
|
|
|
- (org-export-add-to-stack (current-buffer) 's5)))
|
|
|
- `(org-export-as 's5 ,subtreep ,visible-only ,body-only ',ext-plist))
|
|
|
+ (lambda (output)
|
|
|
+ (with-current-buffer (get-buffer-create "*Org S5 Export*")
|
|
|
+ (erase-buffer)
|
|
|
+ (insert output)
|
|
|
+ (goto-char (point-min))
|
|
|
+ (nxml-mode)
|
|
|
+ (org-export-add-to-stack (current-buffer) 's5)))
|
|
|
+ `(org-export-as 's5 ,subtreep ,visible-only ,body-only ',ext-plist))
|
|
|
(let ((outbuf (org-export-to-buffer
|
|
|
- 's5 "*Org S5 Export*"
|
|
|
- subtreep visible-only body-only ext-plist)))
|
|
|
+ 's5 "*Org S5 Export*"
|
|
|
+ subtreep visible-only body-only ext-plist)))
|
|
|
;; Set major mode.
|
|
|
(with-current-buffer outbuf (nxml-mode))
|
|
|
(when org-export-show-temporary-export-buffer
|
|
|
- (switch-to-buffer-other-window outbuf)))))
|
|
|
+ (switch-to-buffer-other-window outbuf)))))
|
|
|
|
|
|
(defun org-s5-export-to-html
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
|
@@ -381,18 +424,18 @@ file-local settings.
|
|
|
Return output file's name."
|
|
|
(interactive)
|
|
|
(let* ((extension (concat "." org-html-extension))
|
|
|
- (file (org-export-output-file-name extension subtreep))
|
|
|
- (org-export-coding-system org-html-coding-system))
|
|
|
+ (file (org-export-output-file-name extension subtreep))
|
|
|
+ (org-export-coding-system org-html-coding-system))
|
|
|
(if async
|
|
|
- (org-export-async-start
|
|
|
- (lambda (f) (org-export-add-to-stack f 's5))
|
|
|
- (let ((org-export-coding-system org-html-coding-system))
|
|
|
- `(expand-file-name
|
|
|
- (org-export-to-file
|
|
|
- 's5 ,file ,subtreep ,visible-only ,body-only ',ext-plist))))
|
|
|
+ (org-export-async-start
|
|
|
+ (lambda (f) (org-export-add-to-stack f 's5))
|
|
|
+ (let ((org-export-coding-system org-html-coding-system))
|
|
|
+ `(expand-file-name
|
|
|
+ (org-export-to-file
|
|
|
+ 's5 ,file ,subtreep ,visible-only ,body-only ',ext-plist))))
|
|
|
(let ((org-export-coding-system org-html-coding-system))
|
|
|
- (org-export-to-file
|
|
|
- 's5 file subtreep visible-only body-only ext-plist)))))
|
|
|
+ (org-export-to-file
|
|
|
+ 's5 file subtreep visible-only body-only ext-plist)))))
|
|
|
|
|
|
(defun org-s5-publish-to-html (plist filename pub-dir)
|
|
|
"Publish an org file to S5 HTML Presentation.
|