emacs-orgmode
[Top][All Lists]
Advanced

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

[O] Exported html structure


From: Vincent Beffara
Subject: [O] Exported html structure
Date: Mon, 27 Feb 2012 11:24:18 -0800
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

Hi,

I would like to use jQuery to make the html exported by Org (un)foldable by clicking around, mimicking what tabbing does within emacs [except, I would like it if folding-and-unfolding-again kept open subtree as they were, which is a bit different from what org-mode does and is the root of my worry ...]. The structure of the HTML exported by Org is not optimal for that. Assume my org file looks like this,

* Header 1
Some contents
** Header 1.1
Contents 1.1
** Header 1.2
Contents 1.2

The HTML output looks like that (some details omitted):

<div class="outline-2">
  <h2>Header 1</h2>
  <div class="outline-text-2">Some contents</div>
  <div class="outline-3">
    <h3>Header 1.1</h3>
    <div class="outline-text-3">Contents 1.1</div>
  </div>
  <div class="outline-3">
    <h3>Header 1.2</h3>
    <div class="outline-text-3">Contents 1.2</div>
  </div>
</div>

There is a wrapper around each subtree, but within it things are a little too linear for what I want to do: it would be very useful to have a div containing the contents of each subtree, everything except the title, in addition to what there already is (so that one could hide it, unfold it on click to show the headers below, and so on). Something like this maybe:

<div class="outline-2">
  <h2>Header 1</h2>
  <div class="contents-2">
    <div class="outline-text-2">Some contents</div>
    <div class="outline-3">
      <h3>Header 1.1</h3>
      <div class="outline-text-3">Contents 1.1</div>
    </div>
    <div class="outline-3">
      <h3>Header 1.2</h3>
      <div class="outline-text-3">Contents 1.2</div>
    </div>
  </div>
</div>

Is that doable ? If so, how can I do it ? Is that a good idea ?

I _can_ exploit jQuery with the current structure to hide/show all the children of a div.outline-2 that are not an h2, and that is my backup plan. I can also probably add the div I want by manipulating the DOM in jQuery but it sounds very sub-optimal. So I wanted to ask here for advice first ... What do you think ?

Thanks for your help !

        /vincent




reply via email to

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