emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Vincent Beffara <vbeffara@ens-lyon.fr>
To: emacs-orgmode@gnu.org
Subject: Exported html structure
Date: Mon, 27 Feb 2012 11:24:18 -0800	[thread overview]
Message-ID: <jigl8s$sr1$1@dough.gmane.org> (raw)

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	other threads:[~2012-02-27 19:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='jigl8s$sr1$1@dough.gmane.org' \
    --to=vbeffara@ens-lyon.fr \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).