summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Frankel <rick@rickster.com>2013-05-28 07:41:30 -0400
committerRick Frankel <rick@rickster.com>2013-05-28 07:41:30 -0400
commit36812e72ac303e5298d41862a25f7ad2386ade29 (patch)
tree37c9b6c92fc268f94b1641dbdfbb8ac90cc94251
parentd3f9b1cb7bd9c74b520855a749637b3816716d89 (diff)
downloadorg-mode-36812e72ac303e5298d41862a25f7ad2386ade29.tar.gz
Fix issues with TOC, internal links and html-doctype.
* contrib/lisp/ox-deck.el (deck): add new deck specific link handler. (org-deck-toc): Add "sec-" to non-custom link ids. (org-deck-link): New function. Rename internal link to point at container instead of heading. (org-deck-template): Use alist doctype instead of string (per changes to ox-html).
-rw-r--r--contrib/lisp/ox-deck.el19
1 files changed, 15 insertions, 4 deletions
diff --git a/contrib/lisp/ox-deck.el b/contrib/lisp/ox-deck.el
index 6338643..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
@@ -300,9 +301,11 @@ and have the id \"title-slide\"."
(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) "-"))
+ (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)