ox-deck.el 22 KB

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