ox-deck.el 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  1. ;;; ox-deck.el --- deck.js Presentation Back-End for Org Export Engine
  2. ;; Copyright (C) 2013 Rick Frankel
  3. ;; Author: Rick Frankel <emacs at rickster dot com>
  4. ;; Keywords: outlines, hypermedia, slideshow
  5. ;; This file is not part of GNU Emacs.
  6. ;; This program is free software; you can redistribute it and/or modify
  7. ;; it under the terms of the GNU General Public License as published by
  8. ;; the Free Software Foundation, either version 3 of the License, or
  9. ;; (at your option) any later version.
  10. ;; This program is distributed in the hope that it will be useful,
  11. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ;; GNU General Public License for more details.
  14. ;; You should have received a copy of the GNU General Public License
  15. ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. ;;; Commentary:
  17. ;; This library implements a deck.js presentation back-end for the Org
  18. ;; generic exporter.
  19. ;; Installation
  20. ;; -------------
  21. ;; Get a copy of deck.js from http://imakewebthings.com/deck.js/ or
  22. ;; the gitub repository at https://github.com/imakewebthings/deck.js.
  23. ;;
  24. ;; Add the path to the extracted code to the variable
  25. ;; `org-deck-directories' There are a number of customization in the
  26. ;; org-export-deck group, most of which can be overrriden with buffer
  27. ;; local customization (starting with DECK_.)
  28. ;; See ox.el and ox-html.el for more details on how this exporter
  29. ;; works (it is derived from ox-html.)
  30. (require 'ox-html)
  31. (eval-when-compile (require 'cl))
  32. (org-export-define-derived-backend 'deck 'html
  33. :menu-entry
  34. '(?d "Export to deck.js HTML Presentation"
  35. ((?H "To temporary buffer" org-deck-export-as-html)
  36. (?h "To file" org-deck-export-to-html)
  37. (?o "To file and open"
  38. (lambda (a s v b)
  39. (if a (org-deck-export-to-html t s v b)
  40. (org-open-file (org-deck-export-to-html nil s v b)))))))
  41. :options-alist
  42. '((:html-link-home "HTML_LINK_HOME" nil nil)
  43. (:html-link-up "HTML_LINK_UP" nil nil)
  44. (:deck-postamble "DECK_POSTAMBLE" nil org-deck-postamble newline)
  45. (:deck-preamble "DECK_PREAMBLE" nil org-deck-preamble newline)
  46. (:html-head-include-default-style "HTML_INCLUDE_DEFAULT_STYLE" nil nil)
  47. (:html-head-include-scripts "HTML_INCLUDE_SCRIPTS" nil nil)
  48. (:deck-base-url "DECK_BASE_URL" nil org-deck-base-url)
  49. (:deck-theme "DECK_THEME" nil org-deck-theme)
  50. (:deck-transition "DECK_TRANSITION" nil org-deck-transition)
  51. (:deck-include-extensions "DECK_INCLUDE_EXTENSIONS" nil
  52. org-deck-include-extensions split)
  53. (:deck-exclude-extensions "DECK_EXCLUDE_EXTENSIONS" nil
  54. org-deck-exclude-extensions split))
  55. :translate-alist
  56. '((headline . org-deck-headline)
  57. (inner-template . org-deck-inner-template)
  58. (item . org-deck-item)
  59. (link . org-deck-link)
  60. (template . org-deck-template)))
  61. (defgroup org-export-deck nil
  62. "Options for exporting Org mode files to deck.js HTML Presentations."
  63. :tag "Org Export DECK"
  64. :group 'org-export-html)
  65. (defcustom org-deck-directories '("./deck.js")
  66. "Directories to search for deck.js components (jquery,
  67. modernizr; core, extensions and themes directories.)"
  68. :group 'org-export-deck
  69. :type '(repeat (string :tag "Directory")))
  70. (defun org-deck--cleanup-components (components)
  71. (remove-duplicates
  72. (car (remove 'nil components))
  73. :test (lambda (x y)
  74. (string= (file-name-nondirectory x)
  75. (file-name-nondirectory y)))))
  76. (defun org-deck--find-extensions ()
  77. "Returns a unique list of all extensions found in
  78. in the extensions directories under `org-deck-directories'"
  79. (org-deck--cleanup-components
  80. (mapcar ; extensions under existing dirs
  81. (lambda (dir)
  82. (when (file-directory-p dir) (directory-files dir t "^[^.]")))
  83. (mapcar ; possible extension directories
  84. (lambda (x) (expand-file-name "extensions" x))
  85. org-deck-directories))))
  86. (defun org-deck--find-css (type)
  87. "Return a unique list of all the css stylesheets in the themes/TYPE
  88. directories under `org-deck-directories'."
  89. (org-deck--cleanup-components
  90. (mapcar
  91. (lambda (dir)
  92. (let ((css-dir (expand-file-name
  93. (concat (file-name-as-directory "themes") type) dir)))
  94. (when (file-directory-p css-dir)
  95. (directory-files css-dir t "\\.css$"))))
  96. org-deck-directories)))
  97. (defun org-deck-list-components ()
  98. "List all available deck extensions, styles and
  99. transitions (with full paths) to a temporary buffer."
  100. (interactive)
  101. (let ((outbuf (get-buffer-create "*deck.js Extensions*")))
  102. (with-current-buffer outbuf
  103. (erase-buffer)
  104. (insert "Extensions\n----------\n")
  105. (insert (mapconcat 'identity (org-deck--find-extensions) "\n"))
  106. (insert "\n\nStyles\n------\n")
  107. (insert (mapconcat 'identity (org-deck--find-css "style") "\n"))
  108. (insert "\n\nTransitions\n----------\n")
  109. (insert (mapconcat 'identity (org-deck--find-css "transition") "\n")))
  110. (switch-to-buffer-other-window outbuf)))
  111. (defcustom org-deck-include-extensions nil
  112. "If non-nil, list of extensions to include instead of all available.
  113. Can be overriden or set with the DECK_INCLUDE_EXTENSIONS property.
  114. During output generation, the extensions found by
  115. `org-deck--find-extensions' are searched for the appropriate
  116. files (scripts and/or stylesheets) to include in the generated
  117. html. The href/src attributes are created relative to `org-deck-base-url'."
  118. :group 'org-export-deck
  119. :type '(repeat (string :tag "Extension")))
  120. (defcustom org-deck-exclude-extensions nil
  121. "If non-nil, list of extensions to exclude.
  122. Can be overriden or set with the DECK_EXCLUDE_EXTENSIONS property."
  123. :group 'org-export-deck
  124. :type '(repeat (string :tag "Extension")))
  125. (defcustom org-deck-theme "swiss.css"
  126. "deck.js theme. Can be overriden with the DECK_THEME property.
  127. If this value contains a path component (\"/\"), it is used as a
  128. literal path (url). Otherwise it is prepended with
  129. `org-deck-base-url'/themes/style/."
  130. :group 'org-export-deck
  131. :type 'string)
  132. (defcustom org-deck-transition "fade.css"
  133. "deck.js transition theme. Can be overriden with the
  134. DECK_TRANSITION property.
  135. If this value contains a path component (\"/\"), it is used as a
  136. literal path (url). Otherwise it is prepended with
  137. `org-deck-base-url'/themes/transition/."
  138. :group 'org-export-deck
  139. :type 'string)
  140. (defcustom org-deck-base-url "deck.js"
  141. "Url prefix to deck.js base directory containing the core, extensions
  142. and themes directories.
  143. Can be overriden with the DECK_BASE_URL property."
  144. :group 'org-export-deck
  145. :type 'string)
  146. (defvar org-deck-pre/postamble-styles
  147. `((both "left: 5px; width: 100%;")
  148. (preamble "position: absolute; top: 10px;")
  149. (postamble ""))
  150. "Alist of css styles for the preamble, postamble and both respectively.
  151. Can be overriden in `org-deck-styles'. See also `org-html-divs'.")
  152. (defcustom org-deck-postamble "<h1>%a - %t</h1>"
  153. "Non-nil means insert a postamble in HTML export.
  154. When set to a string, use this string
  155. as the postamble. When t, insert a string as defined by the
  156. formatting string in `org-html-postamble-format'.
  157. When set to a function, apply this function and insert the
  158. returned string. The function takes the property list of export
  159. options as its only argument.
  160. This is included in the document at the bottom of the content
  161. section, and uses the postamble element and id from
  162. `org-html-divs'. The default places the author and presentation
  163. title at the bottom of each slide.
  164. The css styling is controlled by `org-deck-pre/postamble-styles'.
  165. Setting :deck-postamble in publishing projects will take
  166. precedence over this variable."
  167. :group 'org-export-deck
  168. :type '(choice (const :tag "No postamble" nil)
  169. (const :tag "Default formatting string" t)
  170. (string :tag "Custom formatting string")
  171. (function :tag "Function (must return a string)")))
  172. (defcustom org-deck-preamble nil
  173. "Non-nil means insert a preamble in HTML export.
  174. When set to a string, use this string
  175. as the preamble. When t, insert a string as defined by the
  176. formatting string in `org-html-preamble-format'.
  177. When set to a function, apply this function and insert the
  178. returned string. The function takes the property list of export
  179. options as its only argument.
  180. This is included in the document at the top of content section, and
  181. uses the preamble element and id from `org-html-divs'. The css
  182. styling is controlled by `org-deck-pre/postamble-styles'.
  183. Setting :deck-preamble in publishing projects will take
  184. precedence over this variable."
  185. :group 'org-export-deck
  186. :type '(choice (const :tag "No preamble" nil)
  187. (const :tag "Default formatting string" t)
  188. (string :tag "Custom formatting string")
  189. (function :tag "Function (must return a string)")))
  190. (defvar org-deck-toc-styles
  191. (mapconcat
  192. 'identity
  193. (list
  194. "#table-of-contents a {color: inherit;}"
  195. "#table-of-contents ul {margin-bottom: 0;}"
  196. "#table-of-contents li {padding: 0;}") "\n")
  197. "Default css styles used for formatting a table of contents slide.
  198. Can be overriden in `org-deck-styles'.
  199. Note that when the headline numbering option is true, a \"list-style: none\"
  200. is automatically added to avoid both numbers and bullets on the toc entries.")
  201. (defcustom org-deck-styles
  202. "
  203. #title-slide h1 {
  204. position: static; padding: 0;
  205. margin-top: 10%;
  206. -webkit-transform: none;
  207. -moz-transform: none;
  208. -ms-transform: none;
  209. -o-transform: none;
  210. transform: none;
  211. }
  212. #title-slide h2 {
  213. text-align: center;
  214. border:none;
  215. padding: 0;
  216. margin: 0;
  217. }"
  218. "Deck specific CSS styles to include in exported html.
  219. Defaults to styles for the title page."
  220. :group 'org-export-deck
  221. :type 'string)
  222. (defcustom org-deck-title-slide-template
  223. "<h1>%t</h1>
  224. <h2>%a</h2>
  225. <h2>%e</h2>
  226. <h2>%d</h2>"
  227. "Format template to specify title page section.
  228. See `org-html-postamble-format' for the valid elements which
  229. can be included.
  230. It will be wrapped in the element defined in the :html-container
  231. property, and defaults to the value of `org-html-container-element',
  232. and have the id \"title-slide\"."
  233. :group 'org-export-deck
  234. :type 'string)
  235. (defun org-deck-toc (depth info)
  236. (concat
  237. (format "<%s id='table-of-contents' class='slide'>\n"
  238. (plist-get info :html-container))
  239. (format "<h2>%s</h2>\n" (org-html--translate "Table of Contents" info))
  240. (org-html--toc-text
  241. (mapcar
  242. (lambda (headline)
  243. (let* ((class (org-element-property :HTML_CONTAINER_CLASS headline))
  244. (section-number
  245. (when
  246. (and (not (org-export-low-level-p headline info))
  247. (org-export-numbered-headline-p headline info))
  248. (concat
  249. (mapconcat
  250. 'number-to-string
  251. (org-export-get-headline-number headline info) ".") ". ")))
  252. (title
  253. (concat
  254. section-number
  255. (replace-regexp-in-string ; remove any links in headline...
  256. "</?a[^>]*>" ""
  257. (org-export-data
  258. (org-element-property :title headline) info)))))
  259. (cons
  260. (if (and class (string-match-p "\\<slide\\>" class))
  261. (format
  262. "<a href='#outline-container-%s'>%s</a>"
  263. (or (org-element-property :CUSTOM_ID headline)
  264. (concat
  265. "sec-"
  266. (mapconcat
  267. 'number-to-string
  268. (org-export-get-headline-number headline info) "-")))
  269. title)
  270. title)
  271. (org-export-get-relative-level headline info))))
  272. (org-export-collect-headlines info depth)))
  273. (format "</%s>\n" (plist-get info :html-container))))
  274. (defun org-deck--get-packages (info)
  275. (let ((prefix (concat (plist-get info :deck-base-url) "/"))
  276. (theme (plist-get info :deck-theme))
  277. (transition (plist-get info :deck-transition))
  278. (include (plist-get info :deck-include-extensions))
  279. (exclude (plist-get info :deck-exclude-extensions))
  280. (scripts '()) (sheets '()) (snippets '()))
  281. (add-to-list 'scripts (concat prefix "jquery-1.7.2.min.js"))
  282. (add-to-list 'scripts (concat prefix "core/deck.core.js"))
  283. (add-to-list 'scripts (concat prefix "modernizr.custom.js"))
  284. (add-to-list 'sheets (concat prefix "core/deck.core.css"))
  285. (mapc
  286. (lambda (extdir)
  287. (let* ((name (file-name-nondirectory extdir))
  288. (dir (file-name-as-directory extdir))
  289. (path (concat prefix "extensions/" name "/"))
  290. (base (format "deck.%s." name)))
  291. (when (and (or (eq nil include) (member name include))
  292. (not (member name exclude)))
  293. (when (file-exists-p (concat dir base "js"))
  294. (add-to-list 'scripts (concat path base "js")))
  295. (when (file-exists-p (concat dir base "css"))
  296. (add-to-list 'sheets (concat path base "css")))
  297. (when (file-exists-p (concat dir base "html"))
  298. (add-to-list 'snippets (concat dir base "html"))))))
  299. (org-deck--find-extensions))
  300. (if (not (string-match-p "^[[:space:]]*$" theme))
  301. (add-to-list 'sheets
  302. (if (file-name-directory theme) theme
  303. (format "%sthemes/style/%s" prefix theme))))
  304. (if (not (string-match-p "^[[:space:]]*$" transition))
  305. (add-to-list
  306. 'sheets
  307. (if (file-name-directory transition) transition
  308. (format "%sthemes/transition/%s" prefix transition))))
  309. (list :scripts (nreverse scripts) :sheets (nreverse sheets)
  310. :snippets snippets)))
  311. (defun org-deck-inner-template (contents info)
  312. "Return body of document string after HTML conversion.
  313. CONTENTS is the transcoded contents string. INFO is a plist
  314. holding export options."
  315. (concat contents "\n"))
  316. (defun org-deck-headline (headline contents info)
  317. (let ((org-html-toplevel-hlevel 2)
  318. (class (or (org-element-property :HTML_CONTAINER_CLASS headline) ""))
  319. (level (org-export-get-relative-level headline info)))
  320. (when (and (= 1 level) (not (string-match-p "\\<slide\\>" class)))
  321. (org-element-put-property headline :HTML_CONTAINER_CLASS (concat class " slide")))
  322. (org-html-headline headline contents info)))
  323. (defun org-deck-item (item contents info)
  324. "Transcode an ITEM element from Org to HTML.
  325. CONTENTS holds the contents of the item. INFO is a plist holding
  326. contextual information.
  327. If the containing headline has the property :slide, then
  328. the \"slide\" class will be added to the to the list element,
  329. which will make the list into a \"build\"."
  330. (let ((text (org-html-item item contents info)))
  331. (if (org-export-get-node-property :STEP item t)
  332. (replace-regexp-in-string "^<li>" "<li class='slide'>" text)
  333. text)))
  334. (defun org-deck-link (link desc info)
  335. (replace-regexp-in-string "href=\"#" "href=\"#outline-container-"
  336. (org-html-link link desc info)))
  337. (defun org-deck-template (contents info)
  338. "Return complete document string after HTML conversion.
  339. CONTENTS is the transcoded contents string. INFO is a plist
  340. holding export options."
  341. (let ((pkg-info (org-deck--get-packages info))
  342. (org-html--pre/postamble-class "deck-status")
  343. (info (plist-put
  344. (plist-put info :html-preamble (plist-get info :deck-preamble))
  345. :html-postamble (plist-get info :deck-postamble))))
  346. (mapconcat
  347. 'identity
  348. (list
  349. (org-html-doctype info)
  350. (let ((lang (plist-get info :language)))
  351. (mapconcat
  352. (lambda (x)
  353. (apply
  354. 'format
  355. "<!--%s <html %s lang='%s' xmlns='http://www.w3.org/1999/xhtml'> %s<![endif]-->"
  356. x))
  357. (list `("[if lt IE 7]>" "class='no-js ie6'" ,lang "")
  358. `("[if IE 7]>" "class='no-js ie7'" ,lang "")
  359. `("[if IE 8]>" "class='no-js ie8'" ,lang "")
  360. `("[if gt IE 8]><!-->" "" ,lang "<!--")) "\n"))
  361. "<head>"
  362. (org-deck--build-meta-info info)
  363. (mapconcat
  364. (lambda (sheet)
  365. (format
  366. "<link rel='stylesheet' href='%s' type='text/css' />" sheet))
  367. (plist-get pkg-info :sheets) "\n")
  368. (mapconcat
  369. (lambda (script)
  370. (format
  371. "<script src='%s' type='text/javascript'></script>" script))
  372. (plist-get pkg-info :scripts) "\n")
  373. (org-html--build-mathjax-config info)
  374. "<script type='text/javascript'>"
  375. " $(document).ready(function () { $.deck('.slide'); });"
  376. "</script>"
  377. (org-html--build-head info)
  378. "<style type='text/css'>"
  379. org-deck-toc-styles
  380. (when (plist-get info :section-numbers)
  381. "#table-of-contents ul li {list-style-type: none;}")
  382. (format "#%s, #%s {%s}"
  383. (nth 2 (assq 'preamble org-html-divs))
  384. (nth 2 (assq 'postamble org-html-divs))
  385. (nth 1 (assq 'both org-deck-pre/postamble-styles)))
  386. (format "#%s {%s}"
  387. (nth 2 (assq 'preamble org-html-divs))
  388. (nth 1 (assq 'preamble org-deck-pre/postamble-styles)))
  389. (format "#%s {%s}"
  390. (nth 2 (assq 'postamble org-html-divs))
  391. (nth 1 (assq 'postamble org-deck-pre/postamble-styles)))
  392. org-deck-styles
  393. "</style>"
  394. "</head>"
  395. "<body>"
  396. (format "<%s id='%s' class='deck-container'>"
  397. (nth 1 (assq 'content org-html-divs))
  398. (nth 2 (assq 'content org-html-divs)))
  399. (org-html--build-pre/postamble 'preamble info)
  400. ;; title page
  401. (format "<%s id='title-slide' class='slide'>"
  402. (plist-get info :html-container))
  403. (format-spec org-deck-title-slide-template (org-html-format-spec info))
  404. (format "</%s>" (plist-get info :html-container))
  405. ;; toc page
  406. (let ((depth (plist-get info :with-toc)))
  407. (when depth (org-deck-toc depth info)))
  408. contents
  409. (mapconcat
  410. (lambda (snippet)
  411. (with-temp-buffer (insert-file-contents snippet)
  412. (buffer-string)))
  413. (plist-get pkg-info :snippets) "\n")
  414. (org-html--build-pre/postamble 'postamble info)
  415. (format "</%s>" (nth 1 (assq 'content org-html-divs)))
  416. "</body>"
  417. "</html>\n") "\n")))
  418. (defun org-deck--build-meta-info (info)
  419. "Return meta tags for exported document.
  420. INFO is a plist used as a communication channel."
  421. (let* ((title (org-export-data (plist-get info :title) info))
  422. (author (and (plist-get info :with-author)
  423. (let ((auth (plist-get info :author)))
  424. (and auth (org-export-data auth info)))))
  425. (date (and (plist-get info :with-date)
  426. (let ((date (org-export-get-date info)))
  427. (and date (org-export-data date info)))))
  428. (description (plist-get info :description))
  429. (keywords (plist-get info :keywords)))
  430. (mapconcat
  431. 'identity
  432. (list
  433. (format "<title>%s</title>" title)
  434. (format "<meta http-equiv='Content-Type' content='text/html; charset=%s'/>"
  435. (or (and org-html-coding-system
  436. (fboundp 'coding-system-get)
  437. (coding-system-get
  438. org-html-coding-system 'mime-charset))
  439. "iso-8859-1"))
  440. (mapconcat
  441. (lambda (attr)
  442. (when (< 0 (length (car attr)))
  443. (format "<meta name='%s' content='%s'/>\n"
  444. (nth 1 attr) (car attr))))
  445. (list '("Org-mode" "generator")
  446. `(,author "author")
  447. `(,description "description")
  448. `(,keywords "keywords")) "")) "\n")))
  449. (defun org-deck-export-as-html
  450. (&optional async subtreep visible-only body-only ext-plist)
  451. "Export current buffer to an HTML buffer.
  452. If narrowing is active in the current buffer, only export its
  453. narrowed part.
  454. If a region is active, export that region.
  455. A non-nil optional argument ASYNC means the process should happen
  456. asynchronously. The resulting buffer should be accessible
  457. through the `org-export-stack' interface.
  458. When optional argument SUBTREEP is non-nil, export the sub-tree
  459. at point, extracting information from the headline properties
  460. first.
  461. When optional argument VISIBLE-ONLY is non-nil, don't export
  462. contents of hidden elements.
  463. When optional argument BODY-ONLY is non-nil, only write code
  464. between \"<body>\" and \"</body>\" tags.
  465. EXT-PLIST, when provided, is a property list with external
  466. parameters overriding Org default settings, but still inferior to
  467. file-local settings.
  468. Export is done in a buffer named \"*Org deck.js Export*\", which
  469. will be displayed when `org-export-show-temporary-export-buffer'
  470. is non-nil."
  471. (interactive)
  472. (org-export-to-buffer 'deck "*Org deck.js Export*"
  473. async subtreep visible-only body-only ext-plist (lambda () (nxml-mode))))
  474. (defun org-deck-export-to-html
  475. (&optional async subtreep visible-only body-only ext-plist)
  476. "Export current buffer to a deck.js HTML file.
  477. If narrowing is active in the current buffer, only export its
  478. narrowed part.
  479. If a region is active, export that region.
  480. A non-nil optional argument ASYNC means the process should happen
  481. asynchronously. The resulting file should be accessible through
  482. the `org-export-stack' interface.
  483. When optional argument SUBTREEP is non-nil, export the sub-tree
  484. at point, extracting information from the headline properties
  485. first.
  486. When optional argument VISIBLE-ONLY is non-nil, don't export
  487. contents of hidden elements.
  488. When optional argument BODY-ONLY is non-nil, only write code
  489. between \"<body>\" and \"</body>\" tags.
  490. EXT-PLIST, when provided, is a property list with external
  491. parameters overriding Org default settings, but still inferior to
  492. file-local settings.
  493. Return output file's name."
  494. (interactive)
  495. (let* ((extension (concat "." org-html-extension))
  496. (file (org-export-output-file-name extension subtreep))
  497. (org-export-coding-system org-html-coding-system))
  498. (org-export-to-file 'deck file
  499. async subtreep visible-only body-only ext-plist)))
  500. (defun org-deck-publish-to-html (plist filename pub-dir)
  501. "Publish an org file to deck.js HTML Presentation.
  502. FILENAME is the filename of the Org file to be published. PLIST
  503. is the property list for the given project. PUB-DIR is the
  504. publishing directory. Returns output file name."
  505. (org-publish-org-to 'deck filename ".html" plist pub-dir))
  506. (provide 'ox-deck)
  507. ;;; ox-deck.el ends here