diff options
author | Nicolas Goaziou <n.goaziou@gmail.com> | 2012-08-23 21:24:38 +0200 |
---|---|---|
committer | Nicolas Goaziou <n.goaziou@gmail.com> | 2012-08-23 21:32:12 +0200 |
commit | 5b19471358588746f137635a8ce0c86afb397e31 (patch) | |
tree | 444a94b72247a2d011217b73809bdcb29120d508 | |
parent | a81b54968d3e464cc92e19f46377e08b41e0f807 (diff) | |
download | org-mode-5b19471358588746f137635a8ce0c86afb397e31.tar.gz |
org-e-html: Fix TOC generation with a non numeric value
* contrib/lisp/org-e-html.el (org-e-html-toc): Accept non numeric
values for depth.
(org-e-html-template): Call previous function even when depth isn't
a number.
(org-e-html-keyword): Call previous function even when depth isn't
a number. Also react on #+HTML keywords, not #+LATEX.
-rw-r--r-- | contrib/lisp/org-e-html.el | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/lisp/org-e-html.el b/contrib/lisp/org-e-html.el index 4e9d398..5754259 100644 --- a/contrib/lisp/org-e-html.el +++ b/contrib/lisp/org-e-html.el @@ -1123,8 +1123,8 @@ that uses these same face definitions." (format "<span class=\"%s\">%s</span>" todo-type headline))))) (defun org-e-html-toc (depth info) - (assert (wholenump depth)) - (let* ((headlines (org-export-collect-headlines info depth)) + (let* ((headlines (org-export-collect-headlines + info (and (wholenump depth) depth))) (toc-entries (loop for headline in headlines collect (list (org-e-html-format-headline--wrap @@ -1473,7 +1473,7 @@ original parsed data. INFO is a plist holding export options." <h1 class=\"title\">%s</h1>\n" (org-export-data (plist-get info :title) info)) ;; table of contents (let ((depth (plist-get info :with-toc))) - (when (wholenump depth) (org-e-html-toc depth info))) + (when depth (org-e-html-toc depth info))) ;; document contents contents ;; footnotes section @@ -2084,10 +2084,10 @@ CONTENTS is nil. INFO is a plist holding contextual information." (let ((key (org-element-property :key keyword)) (value (org-element-property :value keyword))) (cond - ((string= key "LATEX") value) + ((string= key "HTML") value) ((string= key "INDEX") (format "\\index{%s}" value)) ;; Invisible targets. - ((string= key "TARGET") nil) ; FIXME + ((string= key "TARGET") nil) ((string= key "TOC") (let ((value (downcase value))) (cond @@ -2095,7 +2095,7 @@ CONTENTS is nil. INFO is a plist holding contextual information." (let ((depth (or (and (string-match "[0-9]+" value) (string-to-number (match-string 0 value))) (plist-get info :with-toc)))) - (when (wholenump depth) (org-e-html-toc depth info)))) + (org-e-html-toc depth info))) ((string= "tables" value) "\\listoftables") ((string= "figures" value) "\\listoffigures") ((string= "listings" value) |