emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Exported html structure
@ 2012-02-27 19:24 Vincent Beffara
  0 siblings, 0 replies; only message in thread
From: Vincent Beffara @ 2012-02-27 19:24 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-02-27 19:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-27 19:24 Exported html structure Vincent Beffara

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).