summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2013-11-06 15:26:53 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2013-11-06 16:12:24 +0100
commit4c94c4d062ce7aa28bc21301ec34857745029f5c (patch)
treea83c722d91b260409069e3e26244f9fb68d0d01a
parent747f46aa1f94fc8375fddd3620e15b9b0c0ff86e (diff)
downloadorg-mode-4c94c4d062ce7aa28bc21301ec34857745029f5c.tar.gz
ox-html: Add TODO keyword to TOC entries
* lisp/ox-html.el (org-html--format-toc-headline): TOC entries are closer to regular headline formatting.
-rw-r--r--lisp/ox-html.el52
1 files changed, 29 insertions, 23 deletions
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index afc2437..c47cc86 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1969,34 +1969,40 @@ and value is its relative level, as an integer."
(defun org-html--format-toc-headline (headline info)
"Return an appropriate table of contents entry for HEADLINE.
INFO is a plist used as a communication channel."
- (let* ((headline-number (org-export-get-headline-number headline info))
- (section-number
- (and (not (org-export-low-level-p headline info))
- (org-export-numbered-headline-p headline info)
- (concat (mapconcat 'number-to-string headline-number ".") ". ")))
+ (let* ((todo (and (plist-get info :with-todo-keywords)
+ (let ((todo (org-element-property :todo-keyword headline)))
+ (and todo (org-export-data todo info)))))
+ (todo-type (and todo (org-element-property :todo-type headline)))
+ (priority (and (plist-get info :with-priority)
+ (org-element-property :priority headline)))
+ (text (org-export-data-with-backend
+ (org-export-get-alt-title headline info)
+ ;; Create an anonymous back-end that will ignore any
+ ;; footnote-reference, link, radio-target and target
+ ;; in table of contents.
+ (org-export-create-backend
+ :parent 'html
+ :transcoders '((footnote-reference . ignore)
+ (link . (lambda (object c i) c))
+ (radio-target . (lambda (object c i) c))
+ (target . ignore)))
+ info))
(tags (and (eq (plist-get info :with-tags) t)
(org-export-get-tags headline info))))
(format "<a href=\"#%s\">%s</a>"
- ;; Label.
(org-export-solidify-link-text
(or (org-element-property :CUSTOM_ID headline)
- (concat "sec-" (mapconcat 'number-to-string
- headline-number "-"))))
- ;; Body.
- (concat section-number
- (org-export-data-with-backend
- (org-export-get-alt-title headline info)
- ;; Create an anonymous back-end that will ignore
- ;; any footnote-reference, link, radio-target and
- ;; target in table of contents.
- (org-export-create-backend
- :parent 'html
- :transcoders '((footnote-reference . ignore)
- (link . (lambda (object c i) c))
- (radio-target . (lambda (object c i) c))
- (target . ignore)))
- info)
- (and tags "&#xa0;&#xa0;&#xa0;") (org-html--tags tags)))))
+ (concat "sec-"
+ (mapconcat
+ #'number-to-string
+ (org-export-get-headline-number headline info)
+ "-"))))
+ (apply (if (functionp org-html-format-headline-function)
+ (lambda (todo todo-type priority text tags &rest ignore)
+ (funcall org-html-format-headline-function
+ todo todo-type priority text tags))
+ #'org-html-format-headline)
+ todo todo-type priority text tags :section-number nil))))
(defun org-html-list-of-listings (info)
"Build a list of listings.