Hi all,

I'd like to add a table of contents to a HTML export with body-only set
to t (to feed into jekyll later), but org-html.el automatically disables
the TOC when body-only is given.

I have used the attached one-line patch without any problems, the (still
XHTML strict compliant) result can be seen here:

http://www.jboecker.de/2010/04/14/general-reference-filing-with-org-mode.html

gitk tells me that the line I have changed was first introduced in
Release 4.75, so is this just a use case that was not thought of when
this was programmed, or is there a specific reason?

Curious,
  Jan
>From bdd811611e4a3cd637b0bae22e9d574846acddc7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20B=C3=B6cker?= <jan.boec...@jboecker.de>
Date: Fri, 16 Apr 2010 10:17:49 +0200
Subject: [PATCH] Allow including a table of contents in a body-only export

---
 lisp/org-html.el |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/org-html.el b/lisp/org-html.el
index 74f3a55..ab1aac2 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -807,7 +807,7 @@ lang=\"%s\" xml:lang=\"%s\">
          (if title (insert (format org-export-html-title-format
                                    (org-html-expand title))))))
 
-      (if (and org-export-with-toc (not body-only))
+      (if org-export-with-toc
          (progn
            (push (format "<h%d>%s</h%d>\n"
                          org-export-html-toplevel-hlevel
-- 
1.7.0.3

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to