summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Frankel <rick@rickster.com>2013-05-26 19:17:18 -0400
committerRick Frankel <rick@rickster.com>2013-05-26 19:17:18 -0400
commit2347dcf76b7b7522e8ed573d8886437736f0f5b6 (patch)
treec246b4537d472317f0cc17d2ca1ff4e344a6ca7f
parent85bd00bae8b485ffa6b8ad497fb1c669ff39da8e (diff)
downloadorg-mode-2347dcf76b7b7522e8ed573d8886437736f0f5b6.tar.gz
Fix handling of internal links and new html doctype option.
* contrib/lisp/ox-deck.el (deck): Add deck specific link function. (org-deck-toc): Generate correct link to slide for custom ids as well as default section ids. (org-deck-link): HTML custom ids link to the headline. deck.js requires linking to the wrapper (slide) so modify the link to point at the container instead of the headline. (org-deck-template): Fix doctype handling to use alist option instead of literal string.
-rw-r--r--contrib/lisp/ox-deck.el21
1 files changed, 16 insertions, 5 deletions
diff --git a/contrib/lisp/ox-deck.el b/contrib/lisp/ox-deck.el
index 1636818..c738389 100644
--- a/contrib/lisp/ox-deck.el
+++ b/contrib/lisp/ox-deck.el
@@ -68,6 +68,7 @@
'((headline . org-deck-headline)
(inner-template . org-deck-inner-template)
(item . org-deck-item)
+ (link . org-deck-link)
(template . org-deck-template)))
(defgroup org-export-deck nil
@@ -298,11 +299,13 @@ and have the id \"title-slide\"."
(cons
(if (and class (string-match-p "\\<slide\\>" class))
(format
- "<a href='#outline-container-sec-%s'>%s</a>"
+ "<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) "-"))
+ (concat
+ "sec-"
+ (mapconcat
+ 'number-to-string
+ (org-export-get-headline-number headline info) "-")))
title)
title)
(org-export-get-relative-level headline info))))
@@ -373,6 +376,10 @@ the \"slide\" class will be added to the to the list element,
(replace-regexp-in-string "^<li>" "<li class='slide'>" text)
text)))
+(defun org-deck-link (link desc info)
+ (replace-regexp-in-string "href=\"#" "href=\"#outline-container-"
+ (org-html-link link desc info)))
+
(defun org-deck-template (contents info)
"Return complete document string after HTML conversion.
CONTENTS is the transcoded contents string. INFO is a plist
@@ -385,7 +392,11 @@ holding export options."
(mapconcat
'identity
(list
- (plist-get info :html-doctype)
+ (let* ((dt (plist-get info :html-doctype))
+ (dt-cons (assoc dt org-html-doctype-alist)))
+ (if dt-cons
+ (cdr dt-cons)
+ dt))
(let ((lang (plist-get info :language)))
(mapconcat
(lambda (x)