2013-02-20 10:32:54 -05:00
|
|
|
;;; ox-s5.el --- S5 Presentation Back-End for Org Export Engine
|
|
|
|
|
2014-01-07 08:18:17 -05:00
|
|
|
;; Copyright (C) 2011-2014 Rick Frankel
|
2013-02-20 10:32:54 -05:00
|
|
|
|
|
|
|
;; Author: Rick Frankel <emacs at rickster dot com>
|
|
|
|
;; Keywords: outlines, hypermedia, S5, wp
|
|
|
|
|
2013-03-10 12:57:47 -04:00
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
|
2013-02-20 10:32:54 -05:00
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
;; This library implements an S5 Presentation back-end for the Org
|
|
|
|
;; generic exporter.
|
|
|
|
|
|
|
|
;; Installation
|
|
|
|
;; ------------
|
|
|
|
;; Get the s5 scripts from
|
|
|
|
;; http://meyerweb.com/eric/tools/s5/
|
|
|
|
;; (Note that the default s5 version is set for using the alpha, 1.2a2.
|
|
|
|
;; Copy the ui dir to somewhere reachable from your published presentation
|
|
|
|
;; The default (`org-s5-ui-url') is set to "ui" (e.g., in the
|
|
|
|
;; same directory as the html file).
|
|
|
|
|
|
|
|
;; Usage
|
|
|
|
;; -----
|
|
|
|
;; Follow the general instructions at the above website. To generate
|
|
|
|
;; incremental builds, you can set the HTML_CONTAINER_CLASS on an
|
|
|
|
;; object to "incremental" to make it build. If you want an outline to
|
2013-02-25 12:55:32 -05:00
|
|
|
;; build, set the :INCREMENTAL property on the parent headline.
|
2013-02-20 10:32:54 -05:00
|
|
|
|
|
|
|
;; To test it, run:
|
|
|
|
;;
|
|
|
|
;; M-x org-s5-export-as-html
|
|
|
|
;;
|
|
|
|
;; in an Org mode buffer. See ox.el and ox-html.el for more details
|
|
|
|
;; on how this exporter works.
|
|
|
|
|
ox: Add #+SUBTITLE property in some backends
* ox-texinfo.el (texinfo, org-texinfo-template): Parse subtitle.
* ox-s5.el (org-s5-title-slide-template):
* ox-deck.el (org-deck-title-slide-template):
* ox-odt.el (odt, org-odt-template):
* ox-latex.el (latex, org-latex-template):
* ox-html.el (html, org-html-format-spec, org-html-template):
* ox-ascii.el (ascii, org-ascii-template--document-title):
* ox-beamer.el (beamer, org-beamer-template): Support #+SUBTITLE.
* ox-html.el (org-html-postamble-format)
(org-html-preamble-format):
* ox-latex.el (org-latex-title-command)
(org-latex-hyperref-template): Update docstring.
* ox-html.el (org-html-style-default): New .subtitle css property.
* ox-beamer.el (org-beamer-subtitle-format):
* ox-latex.el (org-latex-subtitle-format)
(org-latex-subtitle-separate): New variable.
* org.texi (ASCII/Latin-1/UTF-8 export)
(Beamer specific export settings)
(HTML Specific export settings)
(@LaTeX{} specific export settings, CSS support)
(ODT specific export settings)
(Texinfo specific export settings, Document preamble)
(Publishing options, Publishing options): Document #+SUBTITLE.
The patch adds a #+SUBTITLE keyword to ox-ascii, ox-latex, ox-html and
ox-odt.
2015-03-01 16:09:19 -05:00
|
|
|
;; TODOs
|
|
|
|
;; ------
|
|
|
|
;; The title page is formatted using format-spec. This is error prone
|
|
|
|
;; when details are missing and may insert empty tags, like <h2></h2>,
|
|
|
|
;; for missing values.
|
|
|
|
|
2013-02-20 10:32:54 -05:00
|
|
|
(require 'ox-html)
|
2015-03-20 18:12:40 -04:00
|
|
|
(eval-when-compile (require 'cl))
|
2013-02-20 10:32:54 -05:00
|
|
|
|
2013-03-19 11:26:30 -04:00
|
|
|
(org-export-define-derived-backend 's5 'html
|
2013-02-20 10:32:54 -05:00
|
|
|
:menu-entry
|
2013-03-19 11:26:30 -04:00
|
|
|
'(?s "Export to S5 HTML Presentation"
|
|
|
|
((?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)))))))
|
2013-02-20 10:32:54 -05:00
|
|
|
:options-alist
|
2013-03-19 11:26:30 -04:00
|
|
|
'((:html-link-home "HTML_LINK_HOME" nil nil)
|
|
|
|
(:html-link-up "HTML_LINK_UP" nil nil)
|
|
|
|
(: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))
|
2013-02-20 10:32:54 -05:00
|
|
|
:translate-alist
|
2013-03-19 11:26:30 -04:00
|
|
|
'((headline . org-s5-headline)
|
|
|
|
(plain-list . org-s5-plain-list)
|
|
|
|
(inner-template . org-s5-inner-template)
|
|
|
|
(template . org-s5-template)))
|
2013-02-20 10:32:54 -05:00
|
|
|
|
|
|
|
(defgroup org-export-s5 nil
|
|
|
|
"Options for exporting Org mode files to S5 HTML Presentations."
|
|
|
|
:tag "Org Export S5"
|
|
|
|
:group 'org-export-html)
|
|
|
|
|
|
|
|
(defcustom org-s5-version "1.2a2"
|
|
|
|
"Version of s5 being used (for version metadata.) Defaults to
|
|
|
|
s5 v2 alpha 2.
|
|
|
|
Can be overridden with S5_VERSION."
|
|
|
|
:group 'org-export-s5
|
|
|
|
:type 'string)
|
|
|
|
|
|
|
|
(defcustom org-s5-theme-file nil
|
|
|
|
"Url to S5 theme (slides.css) file. Can be overriden with the
|
|
|
|
S5_THEME_FILE property. If nil, defaults to
|
|
|
|
`org-s5-ui-url'/default/slides.css. If it starts with anything but
|
|
|
|
\"http\" or \"/\", it is used as-is. Otherwise the link in generated
|
|
|
|
relative to `org-s5-ui-url'.
|
|
|
|
The links for all other required stylesheets and scripts will be
|
|
|
|
generated relative to `org-s5-ui-url'/default."
|
|
|
|
:group 'org-export-s5
|
|
|
|
:type 'string)
|
|
|
|
|
|
|
|
(defcustom org-s5-ui-url "ui"
|
|
|
|
"Base url to directory containing S5 \"default\" subdirectory
|
|
|
|
and the \"s5-notes.html\" file.
|
|
|
|
Can be overriden with the S5_UI_URL property."
|
|
|
|
:group 'org-export-s5
|
|
|
|
:type 'string)
|
|
|
|
|
|
|
|
(defcustom org-s5-default-view 'slideshow
|
|
|
|
"Setting for \"defaultView\" meta info."
|
|
|
|
:group 'org-export-s5
|
|
|
|
:type '(choice (const slideshow) (const outline)))
|
|
|
|
|
|
|
|
(defcustom org-s5-control-visibility 'hidden
|
|
|
|
"Setting for \"controlVis\" meta info."
|
|
|
|
:group 'org-export-s5
|
|
|
|
:type '(choice (const hidden) (const visibile)))
|
|
|
|
|
2013-03-17 12:07:26 -04:00
|
|
|
(defvar org-s5--divs
|
2013-03-16 15:10:53 -04:00
|
|
|
'((preamble "div" "header")
|
|
|
|
(content "div" "content")
|
|
|
|
(postamble "div" "footer"))
|
2013-03-17 12:07:26 -04:00
|
|
|
"Alist of the three section elements for HTML export.
|
2013-03-16 15:10:53 -04:00
|
|
|
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.
|
|
|
|
|
2013-03-17 12:07:26 -04:00
|
|
|
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.")
|
2013-03-16 15:10:53 -04:00
|
|
|
|
|
|
|
(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."
|
2013-02-20 10:32:54 -05:00
|
|
|
:group 'org-export-s5
|
2013-03-16 15:10:53 -04:00
|
|
|
:type '(choice (const :tag "No postamble" " ")
|
|
|
|
(string :tag "Custom formatting string")
|
|
|
|
(function :tag "Function (must return a 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.
|
2013-02-20 10:32:54 -05:00
|
|
|
|
2013-03-16 15:10:53 -04:00
|
|
|
Setting S5_PREAMBLE option -- or the :s5-preamble in publishing
|
|
|
|
projects -- will take precedence over this variable.
|
2013-03-11 17:49:39 -04:00
|
|
|
|
2013-03-16 15:10:53 -04:00
|
|
|
Note that the default css styling will break if this is set to nil
|
|
|
|
or an empty string."
|
2013-02-20 10:32:54 -05:00
|
|
|
:group 'org-export-s5
|
2013-03-16 15:10:53 -04:00
|
|
|
:type '(choice (const :tag "No preamble" " ")
|
|
|
|
(string :tag "Custom formatting string")
|
|
|
|
(function :tag "Function (must return a string)")))
|
2013-02-20 10:32:54 -05:00
|
|
|
|
2013-03-11 17:49:39 -04:00
|
|
|
(defcustom org-s5-title-slide-template
|
2013-03-16 15:10:53 -04:00
|
|
|
"<h1>%t</h1>
|
ox: Add #+SUBTITLE property in some backends
* ox-texinfo.el (texinfo, org-texinfo-template): Parse subtitle.
* ox-s5.el (org-s5-title-slide-template):
* ox-deck.el (org-deck-title-slide-template):
* ox-odt.el (odt, org-odt-template):
* ox-latex.el (latex, org-latex-template):
* ox-html.el (html, org-html-format-spec, org-html-template):
* ox-ascii.el (ascii, org-ascii-template--document-title):
* ox-beamer.el (beamer, org-beamer-template): Support #+SUBTITLE.
* ox-html.el (org-html-postamble-format)
(org-html-preamble-format):
* ox-latex.el (org-latex-title-command)
(org-latex-hyperref-template): Update docstring.
* ox-html.el (org-html-style-default): New .subtitle css property.
* ox-beamer.el (org-beamer-subtitle-format):
* ox-latex.el (org-latex-subtitle-format)
(org-latex-subtitle-separate): New variable.
* org.texi (ASCII/Latin-1/UTF-8 export)
(Beamer specific export settings)
(HTML Specific export settings)
(@LaTeX{} specific export settings, CSS support)
(ODT specific export settings)
(Texinfo specific export settings, Document preamble)
(Publishing options, Publishing options): Document #+SUBTITLE.
The patch adds a #+SUBTITLE keyword to ox-ascii, ox-latex, ox-html and
ox-odt.
2015-03-01 16:09:19 -05:00
|
|
|
<h2>%s</h2>
|
2013-03-16 15:10:53 -04:00
|
|
|
<h2>%a</h2>
|
2014-01-16 17:48:10 -05:00
|
|
|
<h3>%e</h3>
|
|
|
|
<h4>%d</h4>"
|
2013-03-11 17:49:39 -04:00
|
|
|
"Format template to specify title page section.
|
2013-03-16 15:10:53 -04:00
|
|
|
See `org-html-postamble-format' for the valid elements which
|
|
|
|
can be included.
|
2013-03-11 17:49:39 -04:00
|
|
|
|
|
|
|
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\"."
|
2013-02-20 10:32:54 -05:00
|
|
|
:group 'org-export-s5
|
|
|
|
:type 'string)
|
|
|
|
|
2013-02-26 14:26:27 -05:00
|
|
|
(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))
|
2013-03-11 17:49:39 -04:00
|
|
|
(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))))
|
2013-02-26 14:26:27 -05:00
|
|
|
(concat section-number
|
2013-03-11 17:49:39 -04:00
|
|
|
(org-export-data
|
|
|
|
(org-export-get-alt-title headline info) info)
|
ox-html: Use options instead of hard-coded variables
* contrib/lisp/ox-s5.el (org-s5--format-toc-headline): Apply signature
change.
* lisp/ox-md.el (org-md-headline): Apply signature change.
* lisp/ox-html.el (org-html-format-drawer-function,
org-html-publish-to-html): Small reformatting.
(org-html-infojs-install-script, org-html--build-meta-info,
org-html--build-mathjax-config, org-html-format-spec,
org-html--build-pre/postamble, org-html-template, org-html-toc,
org-html--format-toc-headline, org-html-list-of-listings,
org-html-list-of-tables, org-html-bold, org-html-drawer,
org-html-headline, org-html-inlinetask, org-html-italic,
org-html-checkbox, org-html-inline-image-p, org-html-link,
org-html-section, org-html-strike-through, org-html-table-cell,
org-html-table-row, org-html-underline, org-html-verbatim,
org-html-final-function, org-html-export-to-html): Do not use
hard-coded variable names.
(org-html-format-headline-function,
org-html-format-inlinetask-function): Change default value. Require
an additional argument.
(org-html-format-footnote-reference,
org-html-format-footnotes-section,
org-html-format-footnote-definition, org-html-format-headline,
org-html-format-headline--wrap, org-html-format-section): Remove
functions.
(org-html-footnote-section, org-html-footnote-reference): Apply
function removal. Do not use hard-coded variable names.
(org-html--anchor, org-html--todo, org-html--tags): Change signature.
Do not use hard-coded variable names.
(org-html-radio-target, org-html-target): Apply signature change.
(org-html-format-headline-default-function,
org-html-format-inlinetask-default-function): New functions.
2014-07-29 08:42:15 -04:00
|
|
|
(and tags " ") (org-html--tags tags info))))
|
2013-02-26 14:26:27 -05:00
|
|
|
|
2013-02-20 10:32:54 -05:00
|
|
|
(defun org-s5-toc (depth info)
|
|
|
|
(let* ((headlines (org-export-collect-headlines info depth))
|
2013-03-11 17:49:39 -04:00
|
|
|
(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))))
|
2013-02-20 10:32:54 -05:00
|
|
|
(when toc-entries
|
|
|
|
(concat
|
2013-03-11 17:49:39 -04:00
|
|
|
(format "<%s id='table-of-contents' class='slide'>\n"
|
|
|
|
(plist-get info :html-container))
|
2013-02-20 10:32:54 -05:00
|
|
|
(format "<h1>%s</h1>\n"
|
2013-03-11 17:49:39 -04:00
|
|
|
(org-html--translate "Table of Contents" info))
|
2013-02-20 10:32:54 -05:00
|
|
|
"<div id=\"text-table-of-contents\">"
|
2013-02-26 14:26:27 -05:00
|
|
|
(org-html--toc-text toc-entries)
|
2013-02-20 10:32:54 -05:00
|
|
|
"</div>\n"
|
2013-03-11 17:49:39 -04:00
|
|
|
(format "</%s>\n" (plist-get info :html-container))))))
|
2013-02-20 10:32:54 -05:00
|
|
|
|
2013-03-04 15:01:51 -05:00
|
|
|
(defun org-s5--build-head (info)
|
2013-02-20 10:32:54 -05:00
|
|
|
(let* ((dir (plist-get info :s5-ui-url))
|
2013-03-11 17:49:39 -04:00
|
|
|
(theme (or (plist-get info :s5-theme-file) "default/slides.css")))
|
2013-02-20 10:32:54 -05:00
|
|
|
(mapconcat
|
|
|
|
'identity
|
|
|
|
(list
|
|
|
|
"<!-- style sheet links -->"
|
|
|
|
(mapconcat
|
|
|
|
(lambda (list)
|
2013-03-11 17:49:39 -04:00
|
|
|
(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)))
|
2013-02-20 10:32:54 -05:00
|
|
|
(list
|
2013-03-11 17:49:39 -04:00
|
|
|
'("outline.css" "screen" "outlineStyle")
|
|
|
|
'("print.css" "print" "slidePrint")
|
|
|
|
'("opera.css" "projection" "operaFix")) "\n")
|
2013-02-20 10:32:54 -05:00
|
|
|
(format (concat
|
2013-03-11 17:49:39 -04:00
|
|
|
"<link rel='stylesheet' href='%s' type='text/css'"
|
|
|
|
" media='screen' id='slideProj' />")
|
|
|
|
(if (string-match-p "^\\(http\\|/\\)" theme) theme
|
|
|
|
(concat dir "/" theme)))
|
2013-02-20 10:32:54 -05:00
|
|
|
"<!-- S5 JS -->"
|
|
|
|
(concat
|
|
|
|
"<script src='" dir
|
|
|
|
"/default/slides.js' type='text/javascript'></script>")) "\n")))
|
|
|
|
|
|
|
|
(defun org-s5--build-meta-info (info)
|
|
|
|
(concat
|
|
|
|
(org-html--build-meta-info info)
|
2013-02-25 12:55:32 -05:00
|
|
|
(format "<meta name=\"version\" content=\"S5 %s\" />\n"
|
2013-03-11 17:49:39 -04:00
|
|
|
(plist-get info :s5-version))
|
2013-02-25 12:55:32 -05:00
|
|
|
(format "<meta name='defaultView' content='%s' />\n"
|
|
|
|
(plist-get info :s5-default-view))
|
|
|
|
(format "<meta name='controlVis' content='%s' />"
|
|
|
|
(plist-get info :s5-control-visibility))))
|
2013-02-20 10:32:54 -05:00
|
|
|
|
|
|
|
(defun org-s5-headline (headline contents info)
|
2013-02-25 12:55:32 -05:00
|
|
|
(let ((org-html-toplevel-hlevel 1)
|
|
|
|
(class (or (org-element-property :HTML_CONTAINER_CLASS headline) ""))
|
|
|
|
(level (org-export-get-relative-level headline info)))
|
|
|
|
(when (and (= 1 level) (not (string-match-p "\\<slide\\>" class)))
|
|
|
|
(org-element-put-property headline :HTML_CONTAINER_CLASS (concat class " slide")))
|
|
|
|
(org-html-headline headline contents info)))
|
2013-02-20 10:32:54 -05:00
|
|
|
|
|
|
|
(defun org-s5-plain-list (plain-list contents info)
|
|
|
|
"Transcode a PLAIN-LIST element from Org to HTML.
|
|
|
|
CONTENTS is the contents of the list. INFO is a plist holding
|
|
|
|
contextual information.
|
2013-02-25 12:55:32 -05:00
|
|
|
If a containing headline has the property :INCREMENTAL,
|
2013-02-20 10:32:54 -05:00
|
|
|
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))
|
2013-03-11 17:49:39 -04:00
|
|
|
(tag (case type
|
|
|
|
(ordered "ol")
|
|
|
|
(unordered "ul")
|
|
|
|
(descriptive "dl"))))
|
2013-02-20 10:32:54 -05:00
|
|
|
(format "%s\n%s%s"
|
2013-03-11 17:49:39 -04:00
|
|
|
(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))))
|
2013-02-20 10:32:54 -05:00
|
|
|
|
2013-02-26 14:26:27 -05:00
|
|
|
(defun org-s5-inner-template (contents info)
|
|
|
|
"Return body of document string after HTML conversion.
|
|
|
|
CONTENTS is the transcoded contents string. INFO is a plist
|
|
|
|
holding export options."
|
|
|
|
(concat contents "\n"))
|
|
|
|
|
2013-02-20 10:32:54 -05:00
|
|
|
(defun org-s5-template (contents info)
|
|
|
|
"Return complete document string after HTML conversion.
|
|
|
|
CONTENTS is the transcoded contents string. INFO is a plist
|
|
|
|
holding export options."
|
2017-05-04 14:01:44 -04:00
|
|
|
(let ((info (plist-put
|
|
|
|
(plist-put
|
2013-03-16 15:10:53 -04:00
|
|
|
(plist-put info :html-preamble (plist-get info :s5-preamble))
|
2017-05-04 14:01:44 -04:00
|
|
|
:html-postamble
|
|
|
|
(plist-get info :s5-postamble))
|
|
|
|
:html-divs
|
|
|
|
(if (equal "li" (plist-get info :html-container))
|
|
|
|
(cons '(content "ol" "content") org-s5--divs)
|
|
|
|
org-s5--divs))))
|
2013-03-16 15:10:53 -04:00
|
|
|
(mapconcat
|
|
|
|
'identity
|
|
|
|
(list
|
2013-05-29 09:53:51 -04:00
|
|
|
(org-html-doctype info)
|
2013-03-16 15:10:53 -04:00
|
|
|
(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\">"
|
2013-03-17 12:07:26 -04:00
|
|
|
(nth 1 (assq 'content org-html-divs))
|
|
|
|
(nth 2 (assq 'content org-html-divs)))
|
2013-03-16 15:10:53 -04:00
|
|
|
;; 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
|
2013-03-17 12:07:26 -04:00
|
|
|
(format "</%s>" (nth 1 (assq 'content org-html-divs)))
|
2013-03-16 15:10:53 -04:00
|
|
|
"</body>"
|
|
|
|
"</html>\n") "\n")))
|
2013-02-20 10:32:54 -05:00
|
|
|
|
|
|
|
(defun org-s5-export-as-html
|
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
|
|
|
"Export current buffer to an HTML buffer.
|
|
|
|
|
|
|
|
If narrowing is active in the current buffer, only export its
|
|
|
|
narrowed part.
|
|
|
|
|
|
|
|
If a region is active, export that region.
|
|
|
|
|
|
|
|
A non-nil optional argument ASYNC means the process should happen
|
|
|
|
asynchronously. The resulting buffer should be accessible
|
|
|
|
through the `org-export-stack' interface.
|
|
|
|
|
|
|
|
When optional argument SUBTREEP is non-nil, export the sub-tree
|
|
|
|
at point, extracting information from the headline properties
|
|
|
|
first.
|
|
|
|
|
|
|
|
When optional argument VISIBLE-ONLY is non-nil, don't export
|
|
|
|
contents of hidden elements.
|
|
|
|
|
|
|
|
When optional argument BODY-ONLY is non-nil, only write code
|
|
|
|
between \"<body>\" and \"</body>\" tags.
|
|
|
|
|
|
|
|
EXT-PLIST, when provided, is a property list with external
|
|
|
|
parameters overriding Org default settings, but still inferior to
|
|
|
|
file-local settings.
|
|
|
|
|
|
|
|
Export is done in a buffer named \"*Org S5 Export*\", which
|
|
|
|
will be displayed when `org-export-show-temporary-export-buffer'
|
|
|
|
is non-nil."
|
|
|
|
(interactive)
|
Export back-ends: Apply changes to export functions
* contrib/lisp/ox-confluence.el (org-confluence-export-as-confluence):
* contrib/lisp/ox-deck.el (org-deck-export-as-html,
org-deck-export-to-html):
* contrib/lisp/ox-freemind.el (org-freemind-export-to-freemind):
* contrib/lisp/ox-groff.el (org-groff-export-to-groff,
org-groff-export-to-pdf):
* contrib/lisp/ox-koma-letter.el (org-koma-letter-export-as-latex,
org-koma-letter-export-to-latex, org-koma-letter-export-to-pdf):
* contrib/lisp/ox-rss.el (org-rss-export-as-rss,
org-rss-export-to-rss):
* contrib/lisp/ox-s5.el (org-s5-export-as-html,
org-s5-export-to-html):
* contrib/lisp/ox-taskjuggler.el (org-taskjuggler-export):
* lisp/ob-haskell.el:
* lisp/ox-ascii.el (org-ascii-export-as-ascii,
org-ascii-export-to-ascii):
* lisp/ox-beamer.el (org-beamer-export-as-latex,
org-beamer-export-to-latex, org-beamer-export-to-pdf):
* lisp/ox-html.el (org-html-export-as-html, org-html-export-to-html):
* lisp/ox-icalendar.el (org-icalendar-export-to-ics):
* lisp/ox-latex.el (org-latex-export-as-latex,
org-latex-export-to-pdf):
* lisp/ox-man.el (org-man-export-to-man, org-man-export-to-pdf):
* lisp/ox-md.el (org-md-export-as-markdown,
org-md-export-to-markdown):
* lisp/ox-odt.el (org-odt-export-to-odt):
* lisp/ox-org.el (org-org-export-as-org, org-org-export-to-org):
* lisp/ox-publish.el (org-publish-org-to):
* lisp/ox-texinfo.el (org-texinfo-export-to-texinfo,
org-texinfo-export-to-info):
* testing/lisp/test-ob-exp.el (test-ob-exp/org-babel-exp-src-blocks/w-no-file):
2013-08-07 04:35:42 -04:00
|
|
|
(org-export-to-buffer 's5 "*Org S5 Export*"
|
|
|
|
async subtreep visible-only body-only ext-plist (lambda () (nxml-mode))))
|
2013-02-20 10:32:54 -05:00
|
|
|
|
|
|
|
(defun org-s5-export-to-html
|
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
|
|
|
"Export current buffer to a S5 HTML file.
|
|
|
|
|
|
|
|
If narrowing is active in the current buffer, only export its
|
|
|
|
narrowed part.
|
|
|
|
|
|
|
|
If a region is active, export that region.
|
|
|
|
|
|
|
|
A non-nil optional argument ASYNC means the process should happen
|
|
|
|
asynchronously. The resulting file should be accessible through
|
|
|
|
the `org-export-stack' interface.
|
|
|
|
|
|
|
|
When optional argument SUBTREEP is non-nil, export the sub-tree
|
|
|
|
at point, extracting information from the headline properties
|
|
|
|
first.
|
|
|
|
|
|
|
|
When optional argument VISIBLE-ONLY is non-nil, don't export
|
|
|
|
contents of hidden elements.
|
|
|
|
|
|
|
|
When optional argument BODY-ONLY is non-nil, only write code
|
|
|
|
between \"<body>\" and \"</body>\" tags.
|
|
|
|
|
|
|
|
EXT-PLIST, when provided, is a property list with external
|
|
|
|
parameters overriding Org default settings, but still inferior to
|
|
|
|
file-local settings.
|
|
|
|
|
|
|
|
Return output file's name."
|
|
|
|
(interactive)
|
|
|
|
(let* ((extension (concat "." org-html-extension))
|
2013-03-11 17:49:39 -04:00
|
|
|
(file (org-export-output-file-name extension subtreep))
|
|
|
|
(org-export-coding-system org-html-coding-system))
|
Export back-ends: Apply changes to export functions
* contrib/lisp/ox-confluence.el (org-confluence-export-as-confluence):
* contrib/lisp/ox-deck.el (org-deck-export-as-html,
org-deck-export-to-html):
* contrib/lisp/ox-freemind.el (org-freemind-export-to-freemind):
* contrib/lisp/ox-groff.el (org-groff-export-to-groff,
org-groff-export-to-pdf):
* contrib/lisp/ox-koma-letter.el (org-koma-letter-export-as-latex,
org-koma-letter-export-to-latex, org-koma-letter-export-to-pdf):
* contrib/lisp/ox-rss.el (org-rss-export-as-rss,
org-rss-export-to-rss):
* contrib/lisp/ox-s5.el (org-s5-export-as-html,
org-s5-export-to-html):
* contrib/lisp/ox-taskjuggler.el (org-taskjuggler-export):
* lisp/ob-haskell.el:
* lisp/ox-ascii.el (org-ascii-export-as-ascii,
org-ascii-export-to-ascii):
* lisp/ox-beamer.el (org-beamer-export-as-latex,
org-beamer-export-to-latex, org-beamer-export-to-pdf):
* lisp/ox-html.el (org-html-export-as-html, org-html-export-to-html):
* lisp/ox-icalendar.el (org-icalendar-export-to-ics):
* lisp/ox-latex.el (org-latex-export-as-latex,
org-latex-export-to-pdf):
* lisp/ox-man.el (org-man-export-to-man, org-man-export-to-pdf):
* lisp/ox-md.el (org-md-export-as-markdown,
org-md-export-to-markdown):
* lisp/ox-odt.el (org-odt-export-to-odt):
* lisp/ox-org.el (org-org-export-as-org, org-org-export-to-org):
* lisp/ox-publish.el (org-publish-org-to):
* lisp/ox-texinfo.el (org-texinfo-export-to-texinfo,
org-texinfo-export-to-info):
* testing/lisp/test-ob-exp.el (test-ob-exp/org-babel-exp-src-blocks/w-no-file):
2013-08-07 04:35:42 -04:00
|
|
|
(org-export-to-file 's5 file
|
|
|
|
async subtreep visible-only body-only ext-plist)))
|
2013-02-20 10:32:54 -05:00
|
|
|
|
|
|
|
(defun org-s5-publish-to-html (plist filename pub-dir)
|
|
|
|
"Publish an org file to S5 HTML Presentation.
|
|
|
|
|
|
|
|
FILENAME is the filename of the Org file to be published. PLIST
|
|
|
|
is the property list for the given project. PUB-DIR is the
|
|
|
|
publishing directory.
|
|
|
|
|
|
|
|
Return output file name."
|
|
|
|
(org-publish-org-to 's5 filename ".html" plist pub-dir))
|
|
|
|
|
|
|
|
(provide 'ox-s5)
|
2013-03-15 11:52:46 -04:00
|
|
|
|
|
|
|
;;; ox-s5.el ends here
|