From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: [PATH] [NEW EXPORTER] two slide backends for contrib Date: Tue, 19 Feb 2013 19:18:16 -0500 Message-ID: <20130220001816.GA9315@BigDog.local> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="x+6KMIRAuhnl3hBn" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:55224) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7xOC-0007hp-VC for emacs-orgmode@gnu.org; Tue, 19 Feb 2013 19:18:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7xO7-0007z0-Ro for emacs-orgmode@gnu.org; Tue, 19 Feb 2013 19:18:24 -0500 Received: from [204.62.15.78] (port=38533 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7xO7-0007yV-Kp for emacs-orgmode@gnu.org; Tue, 19 Feb 2013 19:18:19 -0500 Received: from BigDog.local (pool-72-89-40-63.nycmny.fios.verizon.net [72.89.40.63]) by mail.rickster.com (Postfix) with ESMTPS id 3E6C8250E5 for ; Tue, 19 Feb 2013 19:18:18 -0500 (EST) Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --x+6KMIRAuhnl3hBn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Attached are: - ox-deck.el - ox-s5.el Which, respectively, provide deck.js and s5 backends for the new exporter. I would be happy for these to be included in contrib. Note that I have already signed the FSF assignment documents, so they can be safely included in the core if so desired. rick --x+6KMIRAuhnl3hBn Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ox-deck.el" ;;; ox-deck.el --- deck.js Presentation Back-End for Org Export Engine ;; Copyright (C) 2013 Free Software Foundation, Inc. ;; Author: Rick Frankel ;; Keywords: outlines, hypermedia, slideshow ;; 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 . ;;; Commentary: ;; This library implements a deck.js presentation back-end for the Org ;; generic exporter. ;; Installation ;; ------------- ;; Get a copy of deck.js from http://imakewebthings.com/deck.js/ or ;; the gitub repository at https://github.com/imakewebthings/deck.js. ;; ;; Add the path to the extracted code to the variable ;; `org-deck-directories' There are a number of customization in the ;; org-export-deck group, most of which can be overrriden with buffer ;; local customization (starting with DECK_.) ;; See ox.el and ox-html.el for more details on how this exporter ;; works (it is derived from ox-html.) (require 'ox-html) (org-export-define-derived-backend deck html :menu-entry (?s "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))))))) :options-alist ((:html-link-home "HTML_LINK_HOME" nil nil) (:html-link-up "HTML_LINK_UP" nil nil) (:html-mathjax "HTML_MATHJAX" nil "" space) (:html-postamble nil "html-postamble" nil t) (:html-preamble nil "html-preamble" nil t) (:html-style-extra "HTML_STYLE" nil org-html-style-extra newline) (:html-style-include-default "HTML_INCLUDE_DEFAULT" nil nil) (:html-style-include-scripts "HTML_INCLUDE_SCRIPTS" nil nil) (:deck-base-url "DECK_BASE_URL" nil org-deck-base-url) (: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) (:deck-exclude-extensions "DECK_EXCLUDE_EXTENSIONS" nil org-deck-exclude-extensions split) (:deck-directories "DECK_DIRECTORIES" nil org-deck-directories split)) :translate-alist ((headline . org-deck-headline) (inner-template . org-deck-inner-template) (item . org-deck-item) (template . org-deck-template))) (defgroup org-export-deck nil "Options for exporting Org mode files to deck.js HTML Presentations." :tag "Org Export DECK" :group 'org-export-html) (defcustom org-deck-directories nil "Directories to search for deck.js components (jquery, modernizr; core, extensions and themes directories.)" :group 'org-export-deck :type '(repeat (string :tag "Directory"))) (defun org-deck--cleanup-components (components) (remove-duplicates (car (remove 'nil components)) :test (lambda (x 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)))) (defun org-deck--find-css (type) "Return a unique list of all the css stylesheets in the themes/TYPE directories under `org-deck-directories'." (org-deck--cleanup-components (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))) (defun org-deck-list-components () "List all available deck extensions, styles and transitions (with full paths) to a temporary buffer." (interactive) (let ((outbuf (get-buffer-create "*deck.js Extensions*"))) (with-current-buffer outbuf (erase-buffer) (insert "Extensions\n----------\n") (insert (mapconcat 'identity (org-deck--find-extensions) "\n")) (insert "\n\nStyles\n------\n") (insert (mapconcat 'identity (org-deck--find-css "style") "\n")) (insert "\n\nTransitions\n----------\n") (insert (mapconcat 'identity (org-deck--find-css "transition") "\n"))) (switch-to-buffer-other-window outbuf))) (defcustom org-deck-include-extensions nil "If non-nil, list of extensions to include instead of all available. Can be overriden or set with the DECK_INCLUDE_EXTENSIONS property. During output generation, the extensions found by `org-deck--find-extensions' are searched for the appropriate files (scripts and/or stylesheets) to include in the generated html. The href/src attributes are created relative to `org-deck-base-url'." :group 'org-export-deck :type '(repeat (string :tag "Extension"))) (defcustom org-deck-exclude-extensions nil "If non-nil, list of extensions to exclude. Can be overriden or set with the DECK_EXCLUDE_EXTENSIONS property." :group 'org-export-deck :type '(repeat (string :tag "Extension"))) (defcustom org-deck-theme "swiss.css" "deck.js theme. Can be overriden with the DECK_THEME property. If this value contains a path component (\"/\"), it is used as a literal path (url). Otherwise it is prepended with `org-deck-base-url'/themes/style/." :group 'org-export-deck :type 'string) (defcustom org-deck-transition "fade.css" "deck.js transition theme. Can be overriden with the DECK_TRANSITION property. If this value contains a path component (\"/\"), it is used as a literal path (url). Otherwise it is prepended with `org-deck-base-url'/themes/transition/." :group 'org-export-deck :type 'string) (defcustom org-deck-base-url "deck.js" "Url prefix to deck.js base directory containing the core, extensions and themes directories. Can be overriden with the DECK_BASE_URL property." :group 'org-export-deck :type 'string) (defcustom org-deck-footer-template "

%author - %title

" "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