* [PATCH] Synchronize slideshow exporters to ox-html changes. @ 2013-02-24 22:55 Rick Frankel 2013-02-25 9:22 ` Nicolas Goaziou 2013-02-25 9:41 ` Bastien 0 siblings, 2 replies; 6+ messages in thread From: Rick Frankel @ 2013-02-24 22:55 UTC (permalink / raw) To: emacs-orgmode This patch fixes a couple of bugs in the s5 exporter and brings both exporters in-sync w/ the updates to ox-html (uppercase properties, and HTML_CONTAINER_CLASS fix). Note that ox-deck has so many lines of change due to whitespace cleanup (won't happen again :). Rick ------------------------------- Synchronize slideshow exporters to ox-html changes. * ox-deck.el: change menu key to ?d to avoid conflict with ox-s5 (org-deck-headline): use HTML_CONTAINER_CLASS insead of html-container-class (org-html-inner-template): ditto * ox-s5.el (org-s5-headline): ditto --- contrib/lisp/ox-deck.el | 415 ++++++++++++++++++++++++------------------------ contrib/lisp/ox-s5.el | 39 +++-- 2 files changed, 227 insertions(+), 227 deletions(-) diff --git a/contrib/lisp/ox-deck.el b/contrib/lisp/ox-deck.el index 7ae6bb9..db7818f 100644 --- a/contrib/lisp/ox-deck.el +++ b/contrib/lisp/ox-deck.el @@ -40,13 +40,13 @@ (org-export-define-derived-backend deck html :menu-entry - (?s "Export to deck.js HTML Presentation" + (?d "Export to deck.js HTML Presentation" ((?H "To temporary buffer" org-deck-export-as-html) (?h "To file" org-deck-export-to-html) (?o "To file and open" - (lambda (a s v b) - (if a (org-deck-export-to-html t s v b) - (org-open-file (org-deck-export-to-html nil s v b))))))) + (lambda (a s v b) + (if a (org-deck-export-to-html t s v b) + (org-open-file (org-deck-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) @@ -60,11 +60,11 @@ (:deck-theme "DECK_THEME" nil org-deck-theme) (:deck-transition "DECK_TRANSITION" nil org-deck-transition) (:deck-include-extensions "DECK_INCLUDE_EXTENSIONS" nil - org-deck-include-extensions split) + org-deck-include-extensions split) (:deck-exclude-extensions "DECK_EXCLUDE_EXTENSIONS" nil - org-deck-exclude-extensions split) + org-deck-exclude-extensions split) (:deck-directories "DECK_DIRECTORIES" nil - org-deck-directories split)) + org-deck-directories split)) :translate-alist ((headline . org-deck-headline) (inner-template . org-deck-inner-template) @@ -86,19 +86,19 @@ modernizr; core, extensions and themes directories.)" (remove-duplicates (car (remove 'nil components)) :test (lambda (x y) - (string= (file-name-nondirectory x) - (file-name-nondirectory y))))) + (string= (file-name-nondirectory x) + (file-name-nondirectory y))))) (defun org-deck--find-extensions () "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 - (lambda (dir) - (when (file-directory-p dir) (directory-files dir t "^[^.]"))) - (mapcar ; possible extension directories - (lambda (x) (expand-file-name "extensions" x)) - org-deck-directories)))) + (mapcar ; extensions under existing dirs + (lambda (dir) + (when (file-directory-p dir) (directory-files dir t "^[^.]"))) + (mapcar ; possible extension directories + (lambda (x) (expand-file-name "extensions" x)) + org-deck-directories)))) (defun org-deck--find-css (type) "Return a unique list of all the css stylesheets in the themes/TYPE @@ -107,10 +107,10 @@ directories under `org-deck-directories'." (mapcar (lambda (dir) (let ((css-dir (expand-file-name - (concat (file-name-as-directory "themes") type) dir))) - (when (file-directory-p css-dir) - (directory-files css-dir t "\\.css$")))) - org-deck-directories))) + (concat (file-name-as-directory "themes") type) dir))) + (when (file-directory-p css-dir) + (directory-files css-dir t "\\.css$")))) + org-deck-directories))) (defun org-deck-list-components () "List all available deck extensions, styles and @@ -168,7 +168,7 @@ Can be overriden with the DECK_BASE_URL property." :type 'string) (defcustom org-deck-footer-template -"<h1>%author - %title</h1>" + "<h1>%author - %title</h1>" "Format template to specify footer div. Completed using `org-fill-template'. Optional keys include %author, %email, %file, %title and %date. @@ -190,11 +190,11 @@ This is included in a <header> section." #title-slide h1 { position: static; padding: 0; margin-top: 10%; - -webkit-transform: none; - -moz-transform: none; - -ms-transform: none; - -o-transform: none; - transform: none; + -webkit-transform: none; + -moz-transform: none; + -ms-transform: none; + -o-transform: none; + transform: none; } #title-slide h2 { text-align: center; @@ -228,11 +228,11 @@ Note that the wrapper div must include the class \"slide\"." #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; + -webkit-transform: none; + -moz-transform: none; + -ms-transform: none; + -o-transform: none; + Transform: none; } #title-slide h2 { text-align: center; @@ -247,77 +247,77 @@ Note that the wrapper div must include the class \"slide\"." (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)) - (org-html-toc-text - (mapcar - (lambda (headline) - (let* ((class (org-element-property :html-container-class headline)) - (section-number - (when - (and (not (org-export-low-level-p headline info)) - (org-export-numbered-headline-p headline info)) - (concat - (mapconcat - 'number-to-string - (org-export-get-headline-number headline info) ".") ". "))) - (title - (concat - section-number - (replace-regexp-in-string ; remove any links in headline... - "</?a[^>]*>" "" - (org-export-data - (org-element-property :title headline) info))))) - (list - (if (and class (string-match-p "\\<slide\\>" class)) - (format - "<a href='#outline-container-%s'>%s</a>" - (or (org-element-property :CUSTOM_ID headline) - (mapconcat - 'number-to-string - (org-export-get-headline-number headline info) "-")) - title) - title) - (org-export-get-relative-level headline info)))) - (org-export-collect-headlines info depth))) - "</div>\n" )) + "<div id=\"table-of-contents\" class=\"slide\">\n" + (format "<h2>%s</h2>\n" + (org-html--translate "Table of Contents" info)) + (org-html-toc-text + (mapcar + (lambda (headline) + (let* ((class (org-element-property :HTML_CONTAINER_CLASS headline)) + (section-number + (when + (and (not (org-export-low-level-p headline info)) + (org-export-numbered-headline-p headline info)) + (concat + (mapconcat + 'number-to-string + (org-export-get-headline-number headline info) ".") ". "))) + (title + (concat + section-number + (replace-regexp-in-string ; remove any links in headline... + "</?a[^>]*>" "" + (org-export-data + (org-element-property :title headline) info))))) + (list + (if (and class (string-match-p "\\<slide\\>" class)) + (format + "<a href='#outline-container-%s'>%s</a>" + (or (org-element-property :custom-id headline) + (mapconcat + 'number-to-string + (org-export-get-headline-number headline info) "-")) + title) + title) + (org-export-get-relative-level headline info)))) + (org-export-collect-headlines info depth))) + "</div>\n" )) (defun org-deck--get-packages (info) (let ((prefix (concat (plist-get info :deck-base-url) "/")) - (theme (plist-get info :deck-theme)) - (transition (plist-get info :deck-transition)) - (include (plist-get info :deck-include-extensions)) - (exclude (plist-get info :deck-exclude-extensions)) - (scripts '()) (sheets '()) (snippets '())) + (theme (plist-get info :deck-theme)) + (transition (plist-get info :deck-transition)) + (include (plist-get info :deck-include-extensions)) + (exclude (plist-get info :deck-exclude-extensions)) + (scripts '()) (sheets '()) (snippets '())) (add-to-list 'scripts (concat prefix "jquery-1.7.2.min.js")) (add-to-list 'scripts (concat prefix "core/deck.core.js")) (add-to-list 'scripts (concat prefix "modernizr.custom.js")) (add-to-list 'sheets (concat prefix "core/deck.core.css")) - (mapc - (lambda (extdir) - (let* ((name (file-name-nondirectory extdir)) - (dir (file-name-as-directory extdir)) - (path (concat prefix "extensions/" name "/")) - (base (format "deck.%s." name))) - (when (and (or (eq nil include) (member name include)) - (not (member name exclude))) - (when (file-exists-p (concat dir base "js")) - (add-to-list 'scripts (concat path base "js"))) - (when (file-exists-p (concat dir base "css")) - (add-to-list 'sheets (concat path base "css"))) - (when (file-exists-p (concat dir base "html")) - (add-to-list 'snippets (concat dir base "html")))))) - (org-deck--find-extensions)) - (add-to-list 'sheets - (if (file-name-directory theme) theme - (format "%sthemes/style/%s" prefix theme))) - (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))) + (mapc + (lambda (extdir) + (let* ((name (file-name-nondirectory extdir)) + (dir (file-name-as-directory extdir)) + (path (concat prefix "extensions/" name "/")) + (base (format "deck.%s." name))) + (when (and (or (eq nil include) (member name include)) + (not (member name exclude))) + (when (file-exists-p (concat dir base "js")) + (add-to-list 'scripts (concat path base "js"))) + (when (file-exists-p (concat dir base "css")) + (add-to-list 'sheets (concat path base "css"))) + (when (file-exists-p (concat dir base "html")) + (add-to-list 'snippets (concat dir base "html")))))) + (org-deck--find-extensions)) + (add-to-list 'sheets + (if (file-name-directory theme) theme + (format "%sthemes/style/%s" prefix theme))) + (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))) (defun org-html-inner-template (contents info) "Return body of document string after HTML conversion. @@ -332,12 +332,13 @@ holding export options." "\n")) (defun org-deck-headline (headline contents info) - (let ((org-html-toplevel-hlevel 2)) - (org-html-headline - (if (= 1 (+ (org-element-property :level headline) - (plist-get info :headline-offset))) - (org-element-put-property headline :html-container-class "slide") - headline) contents info))) + (let ((org-html-toplevel-hlevel 2) + (class (or (org-element-property :HTML_CONTAINER_CLASS headline) "")) + (level (+ (org-element-property :level headline) + (plist-get info :headline-offset)))) + (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))) (defun org-deck-item (item contents info) "Transcode an ITEM element from Org to HTML. @@ -347,8 +348,8 @@ If the containing headline has the property :slide, then the \"slide\" class will be added to the to the list element, which will make the list into a \"build\"." (let ((text (org-html-item item contents info))) - (if (org-export-get-node-property :step item t) - (replace-regexp-in-string "^<li>" "<li class='slide'>" text) + (if (org-export-get-node-property :STEP item t) + (replace-regexp-in-string "^<li>" "<li class='slide'>" text) text))) (defun org-deck-template-alist (info) @@ -364,104 +365,104 @@ the \"slide\" class will be added to the to the list element, CONTENTS is the transcoded contents string. INFO is a plist holding export options." (let ((pkg-info (org-deck--get-packages info))) - (mapconcat - 'identity - (list - "<!DOCTYPE html>" - (let ((lang (plist-get info :language))) - (mapconcat - (lambda (x) - (apply - 'format - "<!--%s <html class='no-js %s' lang='%s'> %s<![endif]-->" - x)) - (list `("[if lt IE 7]>" "ie6" ,lang "") - `("[if IE 7]>" "ie7" ,lang "") - `("[if IE 8]>" "ie8" ,lang "") - `("[if gt IE 8]><!-->" "" ,lang "<!--")) "\n")) - "<head>" - (org-deck--build-meta-info info) - (mapconcat - (lambda (sheet) - (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 - "<script src='%s' type='text/javascript'></script>" script)) - (plist-get pkg-info :scripts) "\n") - (org-html--build-mathjax-config info) - "<script type='text/javascript'>" - " $(document).ready(function () { $.deck('.slide'); });" - "</script>" - (org-html--build-style info) - org-deck-title-page-style - "</head>" - "<body>" - "<header class='deck-status'>" - (org-fill-template - org-deck-header-template (org-deck-template-alist info)) - "</header>" - "<div class='deck-container'>" - ;; title page - (org-fill-template - org-deck-title-page-template (org-deck-template-alist info)) - ;; toc page - (let ((depth (plist-get info :with-toc))) - (when depth (org-deck-toc depth info))) - contents - (mapconcat - (lambda (snippet) - (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>" - "</body>" - "</html>\n") "\n"))) + 'identity + (list + "<!DOCTYPE html>" + (let ((lang (plist-get info :language))) + (mapconcat + (lambda (x) + (apply + 'format + "<!--%s <html class='no-js %s' lang='%s'> %s<![endif]-->" + x)) + (list `("[if lt IE 7]>" "ie6" ,lang "") + `("[if IE 7]>" "ie7" ,lang "") + `("[if IE 8]>" "ie8" ,lang "") + `("[if gt IE 8]><!-->" "" ,lang "<!--")) "\n")) + "<head>" + (org-deck--build-meta-info info) + (mapconcat + (lambda (sheet) + (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 + "<script src='%s' type='text/javascript'></script>" script)) + (plist-get pkg-info :scripts) "\n") + (org-html--build-mathjax-config info) + "<script type='text/javascript'>" + " $(document).ready(function () { $.deck('.slide'); });" + "</script>" + (org-html--build-style info) + org-deck-title-page-style + "</head>" + "<body>" + "<header class='deck-status'>" + (org-fill-template + org-deck-header-template (org-deck-template-alist info)) + "</header>" + "<div class='deck-container'>" + ;; title page + (org-fill-template + org-deck-title-page-template (org-deck-template-alist info)) + ;; toc page + (let ((depth (plist-get info :with-toc))) + (when depth (org-deck-toc depth info))) + contents + (mapconcat + (lambda (snippet) + (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>" + "</body>" + "</html>\n") "\n"))) (defun org-deck--build-meta-info (info) "Return meta tags for exported document. INFO is a plist used as a communication channel." (let* ((title (org-export-data (plist-get info :title) info)) - (author (and (plist-get info :with-author) - (let ((auth (plist-get info :author))) - (and auth (org-export-data auth info))))) - (date (and (plist-get info :with-date) - (let ((date (plist-get info :date))) - (and date (org-export-data date info))))) - (description (plist-get info :description)) - (keywords (plist-get info :keywords))) + (author (and (plist-get info :with-author) + (let ((auth (plist-get info :author))) + (and auth (org-export-data auth info))))) + (date (and (plist-get info :with-date) + (let ((date (plist-get info :date))) + (and date (org-export-data date info))))) + (description (plist-get info :description)) + (keywords (plist-get info :keywords))) (mapconcat 'identity (list (format "<title>%s</title>" title) (format "<meta charset='%s' />" - (or (and org-html-coding-system - (fboundp 'coding-system-get) - (coding-system-get - org-html-coding-system 'mime-charset)) - "iso-8859-1")) + (or (and org-html-coding-system + (fboundp 'coding-system-get) + (coding-system-get + org-html-coding-system 'mime-charset)) + "iso-8859-1")) (mapconcat (lambda (attr) - (when (< 0 (length (car attr))) - (format "<meta name='%s' content='%s'/>\n" - (nth 1 attr) (car attr)))) + (when (< 0 (length (car attr))) + (format "<meta name='%s' content='%s'/>\n" + (nth 1 attr) (car attr)))) (list '("Org-mode" "generator") - `(,author "author") - `(,description "description") - `(,keywords "keywords")) "")) "\n"))) + `(,author "author") + `(,description "description") + `(,keywords "keywords")) "")) "\n"))) (defun org-deck-export-as-html (&optional async subtreep visible-only body-only ext-plist) "Export current buffer to an HTML buffer. @@ -495,21 +496,21 @@ is non-nil." (interactive) (if async (org-export-async-start - (lambda (output) - (with-current-buffer (get-buffer-create "*Org deck.js Export*") - (erase-buffer) - (insert output) - (goto-char (point-min)) - (nxml-mode) - (org-export-add-to-stack (current-buffer) 'deck))) - `(org-export-as 'deck ,subtreep ,visible-only ,body-only ',ext-plist)) + (lambda (output) + (with-current-buffer (get-buffer-create "*Org deck.js Export*") + (erase-buffer) + (insert output) + (goto-char (point-min)) + (nxml-mode) + (org-export-add-to-stack (current-buffer) 'deck))) + `(org-export-as 'deck ,subtreep ,visible-only ,body-only ',ext-plist)) (let ((outbuf (org-export-to-buffer - 'deck "*Org deck.js Export*" - subtreep visible-only body-only ext-plist))) + 'deck "*Org deck.js 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-deck-export-to-html (&optional async subtreep visible-only body-only ext-plist) @@ -541,18 +542,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 'deck)) - (let ((org-export-coding-system org-html-coding-system)) - `(expand-file-name - (org-export-to-file - 'deck ,file ,subtreep ,visible-only ,body-only ',ext-plist)))) + (org-export-async-start + (lambda (f) (org-export-add-to-stack f 'deck)) + (let ((org-export-coding-system org-html-coding-system)) + `(expand-file-name + (org-export-to-file + 'deck ,file ,subtreep ,visible-only ,body-only ',ext-plist)))) (let ((org-export-coding-system org-html-coding-system)) - (org-export-to-file - 'deck file subtreep visible-only body-only ext-plist))))) + (org-export-to-file + 'deck file subtreep visible-only body-only ext-plist))))) (defun org-deck-publish-to-html (plist filename pub-dir) "Publish an org file to deck.js HTML Presentation. diff --git a/contrib/lisp/ox-s5.el b/contrib/lisp/ox-s5.el index 39f41ef..3d177d6 100644 --- a/contrib/lisp/ox-s5.el +++ b/contrib/lisp/ox-s5.el @@ -37,7 +37,7 @@ ;; 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 -;; build, set the` INCREMENTAL property on the parent headline. +;; build, set the :INCREMENTAL property on the parent headline. ;; To test it, run: ;; @@ -68,7 +68,9 @@ (:html-style-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-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)) :translate-alist ((headline . org-s5-headline) (plain-list . org-s5-plain-list) @@ -196,30 +198,27 @@ Note that the wrapper div must include the class \"slide\"." (defun org-s5--build-meta-info (info) (concat (org-html--build-meta-info info) - (format "<meta name=\"version\" content=\"S5 %s\" />" + (format "<meta name=\"version\" content=\"S5 %s\" />\n" (plist-get info :s5-version)) - "<meta name='defaultView' content='slideshow' />\n" - "<meta name='controlVis' content='hidden' />")) + (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)))) (defun org-s5-headline (headline contents info) - (let ((org-html-toplevel-hlevel 1)) - (org-html-headline - (if (= 1 (+ (org-element-property :level headline) - (plist-get info :headline-offset))) - (org-element-put-property - headline :html-container-class - (mapconcat 'identity - (list - (org-element-property - :html-container-class headline) - "slide") " ")) - headline) contents info))) + (let ((org-html-toplevel-hlevel 1) + (class (or (org-element-property :HTML_CONTAINER_CLASS headline) "")) + (level (+ (org-element-property :level headline) + (plist-get info :headline-offset)))) + (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))) (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. -If a containing headline has the property :incremental, +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)) @@ -230,7 +229,7 @@ which will make the list into a \"build\"." (format "%s\n%s%s" (format "<%s class='org-%s%s'>" tag tag - (if (org-export-get-node-property :incremental plain-list t) + (if (org-export-get-node-property :INCREMENTAL plain-list t) " incremental" "")) contents (org-html-end-plain-list type)))) @@ -239,7 +238,7 @@ which will make the list into a \"build\"." ("title" . ,(car (plist-get info :title))) ("author" . ,(car (plist-get info :author))) ("email" . ,(plist-get info :email)) - ("date" . ,(substring (nth 0 (plist-get info :date)) 0 10)) + ("date" . ,(nth 0 (plist-get info :date))) ("file" . ,(plist-get info :input-file)))) (defun org-s5-template (contents info) -- 1.8.1.2 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] Synchronize slideshow exporters to ox-html changes. 2013-02-24 22:55 [PATCH] Synchronize slideshow exporters to ox-html changes Rick Frankel @ 2013-02-25 9:22 ` Nicolas Goaziou 2013-02-25 9:39 ` Bastien 2013-02-25 18:12 ` Rick Frankel 2013-02-25 9:41 ` Bastien 1 sibling, 2 replies; 6+ messages in thread From: Nicolas Goaziou @ 2013-02-25 9:22 UTC (permalink / raw) To: emacs-orgmode Hello, Rick Frankel <rick@rickster.com> writes: > This patch fixes a couple of bugs in the s5 exporter and brings both > exporters in-sync w/ the updates to ox-html (uppercase properties, and > HTML_CONTAINER_CLASS fix). > > Note that ox-deck has so many lines of change due to whitespace > cleanup (won't happen again :). I have trouble applying this patch. Could you rebase it against current master and resend it? Also, would you mind replacing in both files (+ (org-element-property :level headline) (plist-get info :headline-offset)) occurrences with: (org-export-get-relative-level headline info) Thank you. Regards, -- Nicolas Goaziou ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Synchronize slideshow exporters to ox-html changes. 2013-02-25 9:22 ` Nicolas Goaziou @ 2013-02-25 9:39 ` Bastien 2013-02-25 18:12 ` Rick Frankel 1 sibling, 0 replies; 6+ messages in thread From: Bastien @ 2013-02-25 9:39 UTC (permalink / raw) To: Nicolas Goaziou; +Cc: emacs-orgmode Nicolas Goaziou <n.goaziou@gmail.com> writes: > I have trouble applying this patch. Could you rebase it against current > master and resend it? If I may nitpick, Rick, please take care of using proper sentences in the change log: start with an uppercase letter, end with a full stop. Your patch will go into Emacs, and this is the Emacs policy. Otherwise Nicolas will have to fix typos in the change log... Thanks in advance for this! -- Bastien ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Synchronize slideshow exporters to ox-html changes. 2013-02-25 9:22 ` Nicolas Goaziou 2013-02-25 9:39 ` Bastien @ 2013-02-25 18:12 ` Rick Frankel 2013-02-26 8:10 ` Nicolas Goaziou 1 sibling, 1 reply; 6+ messages in thread From: Rick Frankel @ 2013-02-25 18:12 UTC (permalink / raw) To: emacs-orgmode [-- Attachment #1: Type: text/plain, Size: 820 bytes --] On Mon, Feb 25, 2013 at 10:22:54AM +0100, Nicolas Goaziou wrote: > Hello, > > Rick Frankel <rick@rickster.com> writes: > > > This patch fixes a couple of bugs in the s5 exporter and brings both > > exporters in-sync w/ the updates to ox-html (uppercase properties, and > > HTML_CONTAINER_CLASS fix). > > > > Note that ox-deck has so many lines of change due to whitespace > > cleanup (won't happen again :). > I have trouble applying this patch. Could you rebase it against current > master and resend it? Attached. Also attached is a separate patch to cleanup the whitespace in ox-deck. > Also, would you mind replacing in both files > (+ (org-element-property :level headline) > (plist-get info :headline-offset)) > > occurrences with: > > (org-export-get-relative-level headline info) Fix included. [-- Attachment #2: 0001-Update-contributed-slide-output-to-use-uppercase-pro.patch --] [-- Type: text/plain, Size: 7082 bytes --] From 0c61d7d582dcec74a5fc6823ae5cffbddab8e930 Mon Sep 17 00:00:00 2001 From: Rick Frankel <rick@rickster.com> Date: Mon, 25 Feb 2013 12:55:32 -0500 Subject: [PATCH 1/2] Update contributed slide output to use uppercase properties. * contrib/lisp/ox-deck.el: Change menu key to ?d to avoid conflict with ox-s5. (org-deck-toc): Use HTML_CONTAINER_CLASS instead of html-container-class. (org-deck-headline): Simplify code to use HTML_CONTAINER_CLASS directly, and use org-element-get-relative-level. (org-deck-item): Use uppercase property. * contrib/lisp/ox-s5.el (s5): Add configuration variables for S5 meta data. (org-s5--build-meta-info): ditto. (org-s5-headline): Simplify code to use HTML_CONTAINER_CLASS directly, and use org-element-get-relative-level. (org-s5-plain-list): Use uppercase property. (org-s5-template-alist): Fix bug. (Don't try and substring nil.) --- contrib/lisp/ox-deck.el | 20 ++++++++++---------- contrib/lisp/ox-s5.el | 38 ++++++++++++++++++-------------------- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/contrib/lisp/ox-deck.el b/contrib/lisp/ox-deck.el index 7ae6bb9..203ca8c 100644 --- a/contrib/lisp/ox-deck.el +++ b/contrib/lisp/ox-deck.el @@ -40,7 +40,7 @@ (org-export-define-derived-backend deck html :menu-entry - (?s "Export to deck.js HTML Presentation" + (?d "Export to deck.js HTML Presentation" ((?H "To temporary buffer" org-deck-export-as-html) (?h "To file" org-deck-export-to-html) (?o "To file and open" @@ -253,7 +253,7 @@ Note that the wrapper div must include the class \"slide\"." (org-html-toc-text (mapcar (lambda (headline) - (let* ((class (org-element-property :html-container-class headline)) + (let* ((class (org-element-property :HTML_CONTAINER_CLASS headline)) (section-number (when (and (not (org-export-low-level-p headline info)) @@ -332,12 +332,12 @@ holding export options." "\n")) (defun org-deck-headline (headline contents info) - (let ((org-html-toplevel-hlevel 2)) - (org-html-headline - (if (= 1 (+ (org-element-property :level headline) - (plist-get info :headline-offset))) - (org-element-put-property headline :html-container-class "slide") - headline) contents info))) + (let ((org-html-toplevel-hlevel 2) + (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))) (defun org-deck-item (item contents info) "Transcode an ITEM element from Org to HTML. @@ -347,8 +347,8 @@ If the containing headline has the property :slide, then the \"slide\" class will be added to the to the list element, which will make the list into a \"build\"." (let ((text (org-html-item item contents info))) - (if (org-export-get-node-property :step item t) - (replace-regexp-in-string "^<li>" "<li class='slide'>" text) + (if (org-export-get-node-property :STEP item t) + (replace-regexp-in-string "^<li>" "<li class='slide'>" text) text))) (defun org-deck-template-alist (info) diff --git a/contrib/lisp/ox-s5.el b/contrib/lisp/ox-s5.el index 39f41ef..9b140c5 100644 --- a/contrib/lisp/ox-s5.el +++ b/contrib/lisp/ox-s5.el @@ -37,7 +37,7 @@ ;; 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 -;; build, set the` INCREMENTAL property on the parent headline. +;; build, set the :INCREMENTAL property on the parent headline. ;; To test it, run: ;; @@ -68,7 +68,9 @@ (:html-style-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-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)) :translate-alist ((headline . org-s5-headline) (plain-list . org-s5-plain-list) @@ -196,30 +198,26 @@ Note that the wrapper div must include the class \"slide\"." (defun org-s5--build-meta-info (info) (concat (org-html--build-meta-info info) - (format "<meta name=\"version\" content=\"S5 %s\" />" + (format "<meta name=\"version\" content=\"S5 %s\" />\n" (plist-get info :s5-version)) - "<meta name='defaultView' content='slideshow' />\n" - "<meta name='controlVis' content='hidden' />")) + (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)))) (defun org-s5-headline (headline contents info) - (let ((org-html-toplevel-hlevel 1)) - (org-html-headline - (if (= 1 (+ (org-element-property :level headline) - (plist-get info :headline-offset))) - (org-element-put-property - headline :html-container-class - (mapconcat 'identity - (list - (org-element-property - :html-container-class headline) - "slide") " ")) - headline) contents info))) + (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))) (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. -If a containing headline has the property :incremental, +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)) @@ -230,7 +228,7 @@ which will make the list into a \"build\"." (format "%s\n%s%s" (format "<%s class='org-%s%s'>" tag tag - (if (org-export-get-node-property :incremental plain-list t) + (if (org-export-get-node-property :INCREMENTAL plain-list t) " incremental" "")) contents (org-html-end-plain-list type)))) @@ -239,7 +237,7 @@ which will make the list into a \"build\"." ("title" . ,(car (plist-get info :title))) ("author" . ,(car (plist-get info :author))) ("email" . ,(plist-get info :email)) - ("date" . ,(substring (nth 0 (plist-get info :date)) 0 10)) + ("date" . ,(nth 0 (plist-get info :date))) ("file" . ,(plist-get info :input-file)))) (defun org-s5-template (contents info) -- 1.8.1.2 [-- Attachment #3: 0002-Whitespace-cleanup.patch --] [-- Type: text/plain, Size: 20843 bytes --] From ccbb6506d61b548020b17ea6bd44b66f79f8762f Mon Sep 17 00:00:00 2001 From: Rick Frankel <rick@rickster.com> Date: Mon, 25 Feb 2013 13:09:31 -0500 Subject: [PATCH 2/2] Whitespace cleanup. --- contrib/lisp/ox-deck.el | 398 ++++++++++++++++++++++++------------------------ 1 file changed, 199 insertions(+), 199 deletions(-) diff --git a/contrib/lisp/ox-deck.el b/contrib/lisp/ox-deck.el index 203ca8c..401f0cd 100644 --- a/contrib/lisp/ox-deck.el +++ b/contrib/lisp/ox-deck.el @@ -44,9 +44,9 @@ ((?H "To temporary buffer" org-deck-export-as-html) (?h "To file" org-deck-export-to-html) (?o "To file and open" - (lambda (a s v b) - (if a (org-deck-export-to-html t s v b) - (org-open-file (org-deck-export-to-html nil s v b))))))) + (lambda (a s v b) + (if a (org-deck-export-to-html t s v b) + (org-open-file (org-deck-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) @@ -60,11 +60,11 @@ (:deck-theme "DECK_THEME" nil org-deck-theme) (:deck-transition "DECK_TRANSITION" nil org-deck-transition) (:deck-include-extensions "DECK_INCLUDE_EXTENSIONS" nil - org-deck-include-extensions split) + org-deck-include-extensions split) (:deck-exclude-extensions "DECK_EXCLUDE_EXTENSIONS" nil - org-deck-exclude-extensions split) + org-deck-exclude-extensions split) (:deck-directories "DECK_DIRECTORIES" nil - org-deck-directories split)) + org-deck-directories split)) :translate-alist ((headline . org-deck-headline) (inner-template . org-deck-inner-template) @@ -86,19 +86,19 @@ modernizr; core, extensions and themes directories.)" (remove-duplicates (car (remove 'nil components)) :test (lambda (x y) - (string= (file-name-nondirectory x) - (file-name-nondirectory y))))) + (string= (file-name-nondirectory x) + (file-name-nondirectory y))))) (defun org-deck--find-extensions () "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 - (lambda (dir) - (when (file-directory-p dir) (directory-files dir t "^[^.]"))) - (mapcar ; possible extension directories - (lambda (x) (expand-file-name "extensions" x)) - org-deck-directories)))) + (mapcar ; extensions under existing dirs + (lambda (dir) + (when (file-directory-p dir) (directory-files dir t "^[^.]"))) + (mapcar ; possible extension directories + (lambda (x) (expand-file-name "extensions" x)) + org-deck-directories)))) (defun org-deck--find-css (type) "Return a unique list of all the css stylesheets in the themes/TYPE @@ -107,10 +107,10 @@ directories under `org-deck-directories'." (mapcar (lambda (dir) (let ((css-dir (expand-file-name - (concat (file-name-as-directory "themes") type) dir))) - (when (file-directory-p css-dir) - (directory-files css-dir t "\\.css$")))) - org-deck-directories))) + (concat (file-name-as-directory "themes") type) dir))) + (when (file-directory-p css-dir) + (directory-files css-dir t "\\.css$")))) + org-deck-directories))) (defun org-deck-list-components () "List all available deck extensions, styles and @@ -168,7 +168,7 @@ Can be overriden with the DECK_BASE_URL property." :type 'string) (defcustom org-deck-footer-template -"<h1>%author - %title</h1>" + "<h1>%author - %title</h1>" "Format template to specify footer div. Completed using `org-fill-template'. Optional keys include %author, %email, %file, %title and %date. @@ -190,11 +190,11 @@ This is included in a <header> section." #title-slide h1 { position: static; padding: 0; margin-top: 10%; - -webkit-transform: none; - -moz-transform: none; - -ms-transform: none; - -o-transform: none; - transform: none; + -webkit-transform: none; + -moz-transform: none; + -ms-transform: none; + -o-transform: none; + transform: none; } #title-slide h2 { text-align: center; @@ -228,11 +228,11 @@ Note that the wrapper div must include the class \"slide\"." #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; + -webkit-transform: none; + -moz-transform: none; + -ms-transform: none; + -o-transform: none; + Transform: none; } #title-slide h2 { text-align: center; @@ -247,77 +247,77 @@ Note that the wrapper div must include the class \"slide\"." (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)) - (org-html-toc-text - (mapcar - (lambda (headline) - (let* ((class (org-element-property :HTML_CONTAINER_CLASS headline)) - (section-number - (when - (and (not (org-export-low-level-p headline info)) - (org-export-numbered-headline-p headline info)) - (concat - (mapconcat - 'number-to-string - (org-export-get-headline-number headline info) ".") ". "))) - (title - (concat - section-number - (replace-regexp-in-string ; remove any links in headline... - "</?a[^>]*>" "" - (org-export-data - (org-element-property :title headline) info))))) - (list - (if (and class (string-match-p "\\<slide\\>" class)) - (format - "<a href='#outline-container-%s'>%s</a>" - (or (org-element-property :CUSTOM_ID headline) - (mapconcat - 'number-to-string - (org-export-get-headline-number headline info) "-")) - title) - title) - (org-export-get-relative-level headline info)))) - (org-export-collect-headlines info depth))) - "</div>\n" )) + "<div id=\"table-of-contents\" class=\"slide\">\n" + (format "<h2>%s</h2>\n" + (org-html--translate "Table of Contents" info)) + (org-html-toc-text + (mapcar + (lambda (headline) + (let* ((class (org-element-property :HTML_CONTAINER_CLASS headline)) + (section-number + (when + (and (not (org-export-low-level-p headline info)) + (org-export-numbered-headline-p headline info)) + (concat + (mapconcat + 'number-to-string + (org-export-get-headline-number headline info) ".") ". "))) + (title + (concat + section-number + (replace-regexp-in-string ; remove any links in headline... + "</?a[^>]*>" "" + (org-export-data + (org-element-property :title headline) info))))) + (list + (if (and class (string-match-p "\\<slide\\>" class)) + (format + "<a href='#outline-container-%s'>%s</a>" + (or (org-element-property :CUSTOM_ID headline) + (mapconcat + 'number-to-string + (org-export-get-headline-number headline info) "-")) + title) + title) + (org-export-get-relative-level headline info)))) + (org-export-collect-headlines info depth))) + "</div>\n" )) (defun org-deck--get-packages (info) (let ((prefix (concat (plist-get info :deck-base-url) "/")) - (theme (plist-get info :deck-theme)) - (transition (plist-get info :deck-transition)) - (include (plist-get info :deck-include-extensions)) - (exclude (plist-get info :deck-exclude-extensions)) - (scripts '()) (sheets '()) (snippets '())) + (theme (plist-get info :deck-theme)) + (transition (plist-get info :deck-transition)) + (include (plist-get info :deck-include-extensions)) + (exclude (plist-get info :deck-exclude-extensions)) + (scripts '()) (sheets '()) (snippets '())) (add-to-list 'scripts (concat prefix "jquery-1.7.2.min.js")) (add-to-list 'scripts (concat prefix "core/deck.core.js")) (add-to-list 'scripts (concat prefix "modernizr.custom.js")) (add-to-list 'sheets (concat prefix "core/deck.core.css")) - (mapc - (lambda (extdir) - (let* ((name (file-name-nondirectory extdir)) - (dir (file-name-as-directory extdir)) - (path (concat prefix "extensions/" name "/")) - (base (format "deck.%s." name))) - (when (and (or (eq nil include) (member name include)) - (not (member name exclude))) - (when (file-exists-p (concat dir base "js")) - (add-to-list 'scripts (concat path base "js"))) - (when (file-exists-p (concat dir base "css")) - (add-to-list 'sheets (concat path base "css"))) - (when (file-exists-p (concat dir base "html")) - (add-to-list 'snippets (concat dir base "html")))))) - (org-deck--find-extensions)) - (add-to-list 'sheets - (if (file-name-directory theme) theme - (format "%sthemes/style/%s" prefix theme))) - (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))) + (mapc + (lambda (extdir) + (let* ((name (file-name-nondirectory extdir)) + (dir (file-name-as-directory extdir)) + (path (concat prefix "extensions/" name "/")) + (base (format "deck.%s." name))) + (when (and (or (eq nil include) (member name include)) + (not (member name exclude))) + (when (file-exists-p (concat dir base "js")) + (add-to-list 'scripts (concat path base "js"))) + (when (file-exists-p (concat dir base "css")) + (add-to-list 'sheets (concat path base "css"))) + (when (file-exists-p (concat dir base "html")) + (add-to-list 'snippets (concat dir base "html")))))) + (org-deck--find-extensions)) + (add-to-list 'sheets + (if (file-name-directory theme) theme + (format "%sthemes/style/%s" prefix theme))) + (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))) (defun org-html-inner-template (contents info) "Return body of document string after HTML conversion. @@ -337,7 +337,7 @@ holding export options." (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))) + (org-html-headline headline contents info))) (defun org-deck-item (item contents info) "Transcode an ITEM element from Org to HTML. @@ -364,104 +364,104 @@ the \"slide\" class will be added to the to the list element, CONTENTS is the transcoded contents string. INFO is a plist holding export options." (let ((pkg-info (org-deck--get-packages info))) - (mapconcat - 'identity - (list - "<!DOCTYPE html>" - (let ((lang (plist-get info :language))) - (mapconcat - (lambda (x) - (apply - 'format - "<!--%s <html class='no-js %s' lang='%s'> %s<![endif]-->" - x)) - (list `("[if lt IE 7]>" "ie6" ,lang "") - `("[if IE 7]>" "ie7" ,lang "") - `("[if IE 8]>" "ie8" ,lang "") - `("[if gt IE 8]><!-->" "" ,lang "<!--")) "\n")) - "<head>" - (org-deck--build-meta-info info) - (mapconcat - (lambda (sheet) - (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 - "<script src='%s' type='text/javascript'></script>" script)) - (plist-get pkg-info :scripts) "\n") - (org-html--build-mathjax-config info) - "<script type='text/javascript'>" - " $(document).ready(function () { $.deck('.slide'); });" - "</script>" - (org-html--build-style info) - org-deck-title-page-style - "</head>" - "<body>" - "<header class='deck-status'>" - (org-fill-template - org-deck-header-template (org-deck-template-alist info)) - "</header>" - "<div class='deck-container'>" - ;; title page - (org-fill-template - org-deck-title-page-template (org-deck-template-alist info)) - ;; toc page - (let ((depth (plist-get info :with-toc))) - (when depth (org-deck-toc depth info))) - contents - (mapconcat - (lambda (snippet) - (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>" - "</body>" - "</html>\n") "\n"))) + 'identity + (list + "<!DOCTYPE html>" + (let ((lang (plist-get info :language))) + (mapconcat + (lambda (x) + (apply + 'format + "<!--%s <html class='no-js %s' lang='%s'> %s<![endif]-->" + x)) + (list `("[if lt IE 7]>" "ie6" ,lang "") + `("[if IE 7]>" "ie7" ,lang "") + `("[if IE 8]>" "ie8" ,lang "") + `("[if gt IE 8]><!-->" "" ,lang "<!--")) "\n")) + "<head>" + (org-deck--build-meta-info info) + (mapconcat + (lambda (sheet) + (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 + "<script src='%s' type='text/javascript'></script>" script)) + (plist-get pkg-info :scripts) "\n") + (org-html--build-mathjax-config info) + "<script type='text/javascript'>" + " $(document).ready(function () { $.deck('.slide'); });" + "</script>" + (org-html--build-style info) + org-deck-title-page-style + "</head>" + "<body>" + "<header class='deck-status'>" + (org-fill-template + org-deck-header-template (org-deck-template-alist info)) + "</header>" + "<div class='deck-container'>" + ;; title page + (org-fill-template + org-deck-title-page-template (org-deck-template-alist info)) + ;; toc page + (let ((depth (plist-get info :with-toc))) + (when depth (org-deck-toc depth info))) + contents + (mapconcat + (lambda (snippet) + (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>" + "</body>" + "</html>\n") "\n"))) (defun org-deck--build-meta-info (info) "Return meta tags for exported document. INFO is a plist used as a communication channel." (let* ((title (org-export-data (plist-get info :title) info)) - (author (and (plist-get info :with-author) - (let ((auth (plist-get info :author))) - (and auth (org-export-data auth info))))) - (date (and (plist-get info :with-date) - (let ((date (plist-get info :date))) - (and date (org-export-data date info))))) - (description (plist-get info :description)) - (keywords (plist-get info :keywords))) + (author (and (plist-get info :with-author) + (let ((auth (plist-get info :author))) + (and auth (org-export-data auth info))))) + (date (and (plist-get info :with-date) + (let ((date (plist-get info :date))) + (and date (org-export-data date info))))) + (description (plist-get info :description)) + (keywords (plist-get info :keywords))) (mapconcat 'identity (list (format "<title>%s</title>" title) (format "<meta charset='%s' />" - (or (and org-html-coding-system - (fboundp 'coding-system-get) - (coding-system-get - org-html-coding-system 'mime-charset)) - "iso-8859-1")) + (or (and org-html-coding-system + (fboundp 'coding-system-get) + (coding-system-get + org-html-coding-system 'mime-charset)) + "iso-8859-1")) (mapconcat (lambda (attr) - (when (< 0 (length (car attr))) - (format "<meta name='%s' content='%s'/>\n" - (nth 1 attr) (car attr)))) + (when (< 0 (length (car attr))) + (format "<meta name='%s' content='%s'/>\n" + (nth 1 attr) (car attr)))) (list '("Org-mode" "generator") - `(,author "author") - `(,description "description") - `(,keywords "keywords")) "")) "\n"))) + `(,author "author") + `(,description "description") + `(,keywords "keywords")) "")) "\n"))) (defun org-deck-export-as-html (&optional async subtreep visible-only body-only ext-plist) "Export current buffer to an HTML buffer. @@ -495,21 +495,21 @@ is non-nil." (interactive) (if async (org-export-async-start - (lambda (output) - (with-current-buffer (get-buffer-create "*Org deck.js Export*") - (erase-buffer) - (insert output) - (goto-char (point-min)) - (nxml-mode) - (org-export-add-to-stack (current-buffer) 'deck))) - `(org-export-as 'deck ,subtreep ,visible-only ,body-only ',ext-plist)) + (lambda (output) + (with-current-buffer (get-buffer-create "*Org deck.js Export*") + (erase-buffer) + (insert output) + (goto-char (point-min)) + (nxml-mode) + (org-export-add-to-stack (current-buffer) 'deck))) + `(org-export-as 'deck ,subtreep ,visible-only ,body-only ',ext-plist)) (let ((outbuf (org-export-to-buffer - 'deck "*Org deck.js Export*" - subtreep visible-only body-only ext-plist))) + 'deck "*Org deck.js 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-deck-export-to-html (&optional async subtreep visible-only body-only ext-plist) @@ -541,18 +541,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 'deck)) - (let ((org-export-coding-system org-html-coding-system)) - `(expand-file-name - (org-export-to-file - 'deck ,file ,subtreep ,visible-only ,body-only ',ext-plist)))) + (org-export-async-start + (lambda (f) (org-export-add-to-stack f 'deck)) + (let ((org-export-coding-system org-html-coding-system)) + `(expand-file-name + (org-export-to-file + 'deck ,file ,subtreep ,visible-only ,body-only ',ext-plist)))) (let ((org-export-coding-system org-html-coding-system)) - (org-export-to-file - 'deck file subtreep visible-only body-only ext-plist))))) + (org-export-to-file + 'deck file subtreep visible-only body-only ext-plist))))) (defun org-deck-publish-to-html (plist filename pub-dir) "Publish an org file to deck.js HTML Presentation. -- 1.8.1.2 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] Synchronize slideshow exporters to ox-html changes. 2013-02-25 18:12 ` Rick Frankel @ 2013-02-26 8:10 ` Nicolas Goaziou 0 siblings, 0 replies; 6+ messages in thread From: Nicolas Goaziou @ 2013-02-26 8:10 UTC (permalink / raw) To: emacs-orgmode Rick Frankel <rick@rickster.com> writes: > On Mon, Feb 25, 2013 at 10:22:54AM +0100, Nicolas Goaziou wrote: >> Hello, >> >> Rick Frankel <rick@rickster.com> writes: >> >> > This patch fixes a couple of bugs in the s5 exporter and brings both >> > exporters in-sync w/ the updates to ox-html (uppercase properties, and >> > HTML_CONTAINER_CLASS fix). >> > >> > Note that ox-deck has so many lines of change due to whitespace >> > cleanup (won't happen again :). > >> I have trouble applying this patch. Could you rebase it against current >> master and resend it? > > Attached. > > Also attached is a separate patch to cleanup the whitespace in > ox-deck. > >> Also, would you mind replacing in both files >> (+ (org-element-property :level headline) >> (plist-get info :headline-offset)) >> >> occurrences with: >> >> (org-export-get-relative-level headline info) > > Fix included. Applied. Thank you. Regards, -- Nicolas Goaziou ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Synchronize slideshow exporters to ox-html changes. 2013-02-24 22:55 [PATCH] Synchronize slideshow exporters to ox-html changes Rick Frankel 2013-02-25 9:22 ` Nicolas Goaziou @ 2013-02-25 9:41 ` Bastien 1 sibling, 0 replies; 6+ messages in thread From: Bastien @ 2013-02-25 9:41 UTC (permalink / raw) To: Rick Frankel; +Cc: emacs-orgmode Hi Rick, Rick Frankel <rick@rickster.com> writes: > Note that ox-deck has so many lines of change due to whitespace > cleanup (won't happen again :). It's better to make those whitespace changes into separate commits. Thanks! -- Bastien ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-02-26 8:10 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-02-24 22:55 [PATCH] Synchronize slideshow exporters to ox-html changes Rick Frankel 2013-02-25 9:22 ` Nicolas Goaziou 2013-02-25 9:39 ` Bastien 2013-02-25 18:12 ` Rick Frankel 2013-02-26 8:10 ` Nicolas Goaziou 2013-02-25 9:41 ` Bastien
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).