summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2013-03-16 22:08:26 +0100
committerBastien Guerry <bzg@altern.org>2013-03-16 22:08:26 +0100
commit91a6caa6a26431fbcf5d58aed170fa5a83cd78d3 (patch)
treecd8a4447f0c0bf1edcd8a1d6e6f3c77f8fcfaf4d
parent0c82deb42152a853a48646097748b7e6e16a444d (diff)
parent67a17cfe857a5e3ad58083207c49ce9148f19f97 (diff)
downloadorg-mode-91a6caa6a26431fbcf5d58aed170fa5a83cd78d3.tar.gz
Merge branch 'master' of orgmode.org:org-mode
-rw-r--r--contrib/lisp/ox-deck.el263
-rw-r--r--contrib/lisp/ox-s5.el315
-rw-r--r--lisp/ox-html.el35
3 files changed, 347 insertions, 266 deletions
diff --git a/contrib/lisp/ox-deck.el b/contrib/lisp/ox-deck.el
index 15b7972..d6cdd1c 100644
--- a/contrib/lisp/ox-deck.el
+++ b/contrib/lisp/ox-deck.el
@@ -53,8 +53,8 @@
: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)
+ (:deck-postamble "DECK_POSTAMBLE" nil org-deck-postamble newline)
+ (:deck-preamble "DECK_PREAMBLE" nil org-deck-preamble newline)
(:html-head-include-default-style "HTML_INCLUDE_DEFAULT_STYLE" nil nil)
(:html-head-include-scripts "HTML_INCLUDE_SCRIPTS" nil nil)
(:deck-base-url "DECK_BASE_URL" nil org-deck-base-url)
@@ -92,7 +92,7 @@ modernizr; core, extensions and themes directories.)"
"Returns a unique list of all extensions found in
in the extensions directories under `org-deck-directories'"
(org-deck--cleanup-components
- (mapcar ; extensions under existing dirs
+ (mapcar ; extensions under existing dirs
(lambda (dir)
(when (file-directory-p dir) (directory-files dir t "^[^.]")))
(mapcar ; possible extension directories
@@ -166,89 +166,116 @@ Can be overriden with the DECK_BASE_URL property."
:group 'org-export-deck
:type 'string)
-(defcustom org-deck-footer-template
- "<h1>%author - %title</h1>"
- "Format template to specify footer div.
-Completed using `org-fill-template'.
-Optional keys include %author, %email, %file, %title and %date.
-This is included in a <footer> section."
- :group 'org-export-deck
- :type 'string)
+(defvar org-deck-pre/postamble-styles
+ `((both "left: 5px; width: 100%;")
+ (preamble "position: absolute; top: 10px;")
+ (postamble ""))
+ "Alist of css styles for the preamble, postamble and both respectively.
+Can be overriden in `org-deck-styles'. See also `org-html-divs'.")
-(defcustom org-deck-header-template ""
- "Format template to specify page. Completed using `org-fill-template'.
-Optional keys include %author, %email, %file, %title and %date.
-This is included in a <header> section."
- :group 'org-export-deck
- :type 'string)
+(defcustom org-deck-postamble "<h1>%a - %t</h1>"
+ "Non-nil means insert a postamble in HTML export.
+
+When set to a string, use this string
+as the postamble. When t, insert a string as defined by the
+formatting string in `org-html-postamble-format'.
+
+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.
-(defcustom org-deck-title-page-style
- "<style type='text/css'>
- header, footer { left: 5px; width: 100% }
- header { position: absolute; top: 10px; }
- #title-slide h1 {
- position: static; padding: 0;
- margin-top: 10%;
- -webkit-transform: none;
- -moz-transform: none;
- -ms-transform: none;
- -o-transform: none;
- transform: none;
- }
- #title-slide h2 {
- text-align: center;
- border:none;
- padding: 0;
- margin: 0;
- }
-</style>"
- "CSS styles to use for title page"
+This is included in the document at the bottom of the content
+section, and uses the postamble element and id from
+`org-html-divs'. The default places the author and presentation
+title at the bottom of each slide.
+
+The css styling is controlled by `org-deck-pre/postamble-styles'.
+
+Setting :deck-postamble in publishing projects will take
+precedence over this variable."
:group 'org-export-deck
- :type 'string)
+ :type '(choice (const :tag "No postamble" nil)
+ (const :tag "Default formatting string" t)
+ (string :tag "Custom formatting string")
+ (function :tag "Function (must return a string)")))
+
+(defcustom org-deck-preamble nil
+ "Non-nil means insert a preamble in HTML export.
+
+When set to a string, use this string
+as the preamble. When t, insert a string as defined by the
+formatting string in `org-html-preamble-format'.
+
+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.
-(defcustom org-deck-title-page-template
- "<div class='slide' id='title-slide'>
-<h1>%title</h1>
-<h2>%author</h2>
-<h2>%email</h2>
-<h2>%date</h2>
-</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\"."
+This is included in the document at the top of content section, and
+uses the preamble element and id from `org-html-divs'. The css
+styling is controlled by `org-deck-pre/postamble-styles'.
+
+Setting :deck-preamble in publishing projects will take
+precedence over this variable."
+ :group 'org-export-deck
+ :type '(choice (const :tag "No preamble" nil)
+ (const :tag "Default formatting string" t)
+ (string :tag "Custom formatting string")
+ (function :tag "Function (must return a string)")))
+
+(defvar org-deck-toc-styles
+ (mapconcat
+ 'identity
+ (list
+ "#table-of-contents a {color: inherit;}"
+ "#table-of-contents ul {margin-bottom: 0;}"
+ "#table-of-contents li {padding: 0;}") "\n")
+ "Default css styles used for formatting a table of contents slide.
+Can be overriden in `org-deck-styles'.
+Note that when the headline numbering option is true, a \"list-style: none\"
+is automatically added to avoid both numbers and bullets on the toc entries.")
+
+(defcustom org-deck-styles
+ "
+#title-slide h1 {
+ position: static; padding: 0;
+ margin-top: 10%;
+ -webkit-transform: none;
+ -moz-transform: none;
+ -ms-transform: none;
+ -o-transform: none;
+ transform: none;
+}
+#title-slide h2 {
+ text-align: center;
+ border:none;
+ padding: 0;
+ margin: 0;
+}"
+ "Deck specific CSS styles to include in exported html.
+Defaults to styles for the title page."
:group 'org-export-deck
:type 'string)
-(defcustom org-deck-toc-style
- "<style type='text/css'>
- header, footer { left: 5px; width: 100% }
- header { position: absolute; top: 10px; }
- #table-of-contents h1 {
- position: static; padding: 0;
- margin-top: 10%;
- -webkit-transform: none;
- -moz-transform: none;
- -ms-transform: none;
- -o-transform: none;
- Transform: none;
- }
- #title-slide h2 {
- text-align: center;
- border:none;
- padding: 0;
- margin: 0;
- }
-</style>"
- "CSS styles to use for title page"
+(defcustom org-deck-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-deck
:type 'string)
(defun org-deck-toc (depth info)
(concat
- "<div id=\"table-of-contents\" class=\"slide\">\n"
- (format "<h2>%s</h2>\n"
- (org-html--translate "Table of Contents" info))
+ (format "<%s id='table-of-contents' class='slide'>\n"
+ (plist-get info :html-container))
+ (format "<h2>%s</h2>\n" (org-html--translate "Table of Contents" info))
(org-html--toc-text
(mapcar
(lambda (headline)
@@ -280,7 +307,7 @@ Note that the wrapper div must include the class \"slide\"."
title)
(org-export-get-relative-level headline info))))
(org-export-collect-headlines info depth)))
- "</div>\n"))
+ (format "</%s>\n" (plist-get info :html-container))))
(defun org-deck--get-packages (info)
(let ((prefix (concat (plist-get info :deck-base-url) "/"))
@@ -309,14 +336,14 @@ Note that the wrapper div must include the class \"slide\"."
(add-to-list 'snippets (concat dir base "html"))))))
(org-deck--find-extensions))
(if (not (string-match-p "^[[:space:]]*$" theme))
- (add-to-list 'sheets
- (if (file-name-directory theme) theme
- (format "%sthemes/style/%s" prefix theme))))
+ (add-to-list 'sheets
+ (if (file-name-directory theme) theme
+ (format "%sthemes/style/%s" prefix theme))))
(if (not (string-match-p "^[[:space:]]*$" transition))
- (add-to-list
- 'sheets
- (if (file-name-directory transition) transition
- (format "%sthemes/transition/%s" prefix transition))))
+ (add-to-list
+ 'sheets
+ (if (file-name-directory transition) transition
+ (format "%sthemes/transition/%s" prefix transition))))
(list :scripts (nreverse scripts) :sheets (nreverse sheets)
:snippets snippets)))
@@ -346,33 +373,29 @@ the \"slide\" class will be added to the to the list element,
(replace-regexp-in-string "^<li>" "<li class='slide'>" text)
text)))
-(defun org-deck-template-alist (info)
- (list
- `("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))))
-
(defun org-deck-template (contents info)
"Return complete document string after HTML conversion.
CONTENTS is the transcoded contents string. INFO is a plist
holding export options."
- (let ((pkg-info (org-deck--get-packages info)))
+ (let ((pkg-info (org-deck--get-packages info))
+ (org-html--pre/postamble-class "deck-status")
+ (info (plist-put
+ (plist-put info :html-preamble (plist-get info :deck-preamble))
+ :html-postamble (plist-get info :deck-postamble))))
(mapconcat
'identity
(list
- "<!DOCTYPE html>"
+ (plist-get info :html-doctype)
(let ((lang (plist-get info :language)))
(mapconcat
(lambda (x)
(apply
'format
- "<!--%s <html class='no-js %s' lang='%s'> %s<![endif]-->"
+ "<!--%s <html %s lang='%s' xmlns='http://www.w3.org/1999/xhtml'> %s<![endif]-->"
x))
- (list `("[if lt IE 7]>" "ie6" ,lang "")
- `("[if IE 7]>" "ie7" ,lang "")
- `("[if IE 8]>" "ie8" ,lang "")
+ (list `("[if lt IE 7]>" "class='no-js ie6'" ,lang "")
+ `("[if IE 7]>" "class='no-js ie7'" ,lang "")
+ `("[if IE 8]>" "class='no-js ie8'" ,lang "")
`("[if gt IE 8]><!-->" "" ,lang "<!--")) "\n"))
"<head>"
(org-deck--build-meta-info info)
@@ -381,13 +404,6 @@ holding export options."
(format
"<link rel='stylesheet' href='%s' type='text/css' />" sheet))
(plist-get pkg-info :sheets) "\n")
- "<style type='text/css'>"
- "#table-of-contents a {color: inherit;}"
- "#table-of-contents ul {margin-bottom: 0;}"
- (when (plist-get info :section-numbers)
- "#table-of-contents ul li {list-style-type: none;}")
- "</style>"
- ""
(mapconcat
(lambda (script)
(format
@@ -398,17 +414,33 @@ holding export options."
" $(document).ready(function () { $.deck('.slide'); });"
"</script>"
(org-html--build-head info)
- org-deck-title-page-style
+ "<style type='text/css'>"
+ org-deck-toc-styles
+ (when (plist-get info :section-numbers)
+ "#table-of-contents ul li {list-style-type: none;}")
+ (format "#%s, #%s {%s}"
+ (nth 2 (assq 'preamble org-html-divs))
+ (nth 2 (assq 'postamble org-html-divs))
+ (nth 1 (assq 'both org-deck-pre/postamble-styles)))
+ (format "#%s {%s}"
+ (nth 2 (assq 'preamble org-html-divs))
+ (nth 1 (assq 'preamble org-deck-pre/postamble-styles)))
+ (format "#%s {%s}"
+ (nth 2 (assq 'postamble org-html-divs))
+ (nth 1 (assq 'postamble org-deck-pre/postamble-styles)))
+ org-deck-styles
+ "</style>"
"</head>"
"<body>"
- "<header class='deck-status'>"
- (org-fill-template
- org-deck-header-template (org-deck-template-alist info))
- "</header>"
- "<div class='deck-container'>"
+ (format "<%s id='%s' class='deck-container'>"
+ (nth 1 (assq 'content org-html-divs))
+ (nth 2 (assq 'content org-html-divs)))
+ (org-html--build-pre/postamble 'preamble info)
;; title page
- (org-fill-template
- org-deck-title-page-template (org-deck-template-alist info))
+ (format "<%s id='title-slide' class='slide'>"
+ (plist-get info :html-container))
+ (format-spec org-deck-title-slide-template (org-html-format-spec info))
+ (format "</%s>" (plist-get info :html-container))
;; toc page
(let ((depth (plist-get info :with-toc)))
(when depth (org-deck-toc depth info)))
@@ -418,11 +450,8 @@ holding export options."
(with-temp-buffer (insert-file-contents snippet)
(buffer-string)))
(plist-get pkg-info :snippets) "\n")
- "<footer class='deck-status'>"
- (org-fill-template
- org-deck-footer-template (org-deck-template-alist info))
- "</footer>"
- "</div>"
+ (org-html--build-pre/postamble 'postamble info)
+ (format "</%s>" (nth 1 (assq 'content org-html-divs)))
"</body>"
"</html>\n") "\n")))
@@ -442,7 +471,7 @@ INFO is a plist used as a communication channel."
'identity
(list
(format "<title>%s</title>" title)
- (format "<meta charset='%s' />"
+ (format "<meta http-equiv='Content-Type' content='text/html; charset=%s'/>"
(or (and org-html-coding-system
(fboundp 'coding-system-get)
(coding-system-get
diff --git a/contrib/lisp/ox-s5.el b/contrib/lisp/ox-s5.el
index a2bcf97..76f5fa6 100644
--- a/contrib/lisp/ox-s5.el
+++ b/contrib/lisp/ox-s5.el
@@ -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" "&#x20;")
+ (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 "&#x20;"
+ "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" "&#x20;")
+ (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 "&nbsp;&nbsp;&nbsp;") (org-html--tags tags))))
+ (org-export-data
+ (org-export-get-alt-title headline info) info)
+ (and tags "&nbsp;&nbsp;&nbsp;") (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.
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 7af1a60..457fb44 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -140,6 +140,9 @@
"FORMAT used by `format-time-string' for timestamps in
preamble, postamble and metadata.")
+(defvar org-html--pre/postamble-class "status"
+ "CSS class used for pre/postamble")
+
(defconst org-html-special-string-regexps
'(("\\\\-" . "&#x00ad;") ; shy
("---\\([^-]\\)" . "&#x2014;\\1") ; mdash
@@ -1487,22 +1490,27 @@ INFO is a plist used as a communication channel."
;; Return the modified template.
(org-element-normalize-string template))))
+(defun org-html-format-spec (info)
+ "Return format specification for elements that can be
+used in the preamble or postamble."
+ `((?t . ,(org-export-data (plist-get info :title) info))
+ (?d . ,(org-export-data (plist-get info :date) info))
+ (?T . ,(format-time-string org-html--timestamp-format))
+ (?a . ,(org-export-data (plist-get info :author) info))
+ (?e . ,(mapconcat
+ (lambda (e)
+ (format "<a href=\"mailto:%s\">%s</a>" e e))
+ (split-string (plist-get info :email) ",+ *")
+ ", "))
+ (?c . ,(plist-get info :creator))
+ (?v . ,(or org-html-validation-link ""))))
+
(defun org-html--build-pre/postamble (type info)
"Return document preamble or postamble as a string, or nil.
TYPE is either 'preamble or 'postamble, INFO is a plist used as a
communication channel."
(let ((section (plist-get info (intern (format ":html-%s" type))))
- (spec `((?t . ,(org-export-data (plist-get info :title) info))
- (?d . ,(org-export-data (plist-get info :date) info))
- (?T . ,(format-time-string org-html--timestamp-format))
- (?a . ,(org-export-data (plist-get info :author) info))
- (?e . ,(mapconcat
- (lambda (e)
- (format "<a href=\"mailto:%s\">%s</a>" e e))
- (split-string (plist-get info :email) ",+ *")
- ", "))
- (?c . ,(plist-get info :creator))
- (?v . ,(or org-html-validation-link "")))))
+ (spec (org-html-format-spec info)))
(when section
(let ((section-contents
(if (functionp section) (funcall section info)
@@ -1554,9 +1562,10 @@ communication channel."
spec))))))
(when (org-string-nw-p section-contents)
(concat
- (format "<%s id=\"%s\">\n"
+ (format "<%s id=\"%s\" class=\"%s\">\n"
(nth 1 (assq type org-html-divs))
- (nth 2 (assq type org-html-divs)))
+ (nth 2 (assq type org-html-divs))
+ org-html--pre/postamble-class)
(org-element-normalize-string section-contents)
(format "</%s>\n" (nth 1 (assq type org-html-divs)))))))))