emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] how to both :body-only t and :table-of-contents t


From: G. Jay Kerns
Subject: [O] how to both :body-only t and :table-of-contents t
Date: Wed, 21 Sep 2011 15:40:48 -0400

Dear Org Mode list,

First: congratulations on Org mode; it is truly dynamite.

I am publishing a project to HTML for the purposes of Jekyll
post-processing.  For this, I need to set :body-only t so I can put
the YAML frontmatter at the top of my file.  However, I would also
like to have the TOC exported (only), right after the <body> tag,
which it correctly does whenever :body-only isn't t.

In other words, it looks like I am obliged to :body-only t which cuts
out header/footer/TOC or I can NOT do :body-only t which will give me
the TOC plus a bunch of extra stuff.

My question:  is it possible to do what I want?  Is there some sort of
YAML {{ page.toc }} that I'm missing somewhere, or is there some
combination of publishing options that I've missed that will export an
org file to an HTML file that looks like this:

---
layout: default
title: whatever
---

<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">blah blah blah </a></li>
<li><a href="#sec-2">blah blah blah </a></li>
</ul>
</div>
</div>

Rest of exported content here....?

Thanks for any advice, and again, THANK YOU to the Org Mode team.

Best,
Jay



reply via email to

[Prev in Thread] Current Thread [Next in Thread]