From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Clemente Subject: Re: collapsing some headings on html export? Date: Fri, 26 Aug 2011 18:04:16 +0200 Message-ID: <87ippkkvlr.wl%n142857@gmail.com> References: <4E56AE6B.1030903@christianmoe.com> <87mxewlfc3.wl%n142857@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:55303) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwytK-0004Rj-TO for emacs-orgmode@gnu.org; Fri, 26 Aug 2011 12:04:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwytJ-0006qB-IO for emacs-orgmode@gnu.org; Fri, 26 Aug 2011 12:04:22 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:42720) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwytJ-0006q1-Cb for emacs-orgmode@gnu.org; Fri, 26 Aug 2011 12:04:21 -0400 Received: by wwf10 with SMTP id 10so2923013wwf.30 for ; Fri, 26 Aug 2011 09:04:20 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Matt Price Cc: org-mode Mailinglist El Fri, 26 Aug 2011 09:41:38 -0400 Matt Price va escriure: >=20 > On Fri, Aug 26, 2011 at 4:58 AM, Daniel Clemente wrot= e: > > =C2=A0I did it with this code: > > http://www.danielclemente.com/pagina/esquemadorg.js > > http://www.danielclemente.com/pagina/esquemadorg.css > > > > Demo: http://www.danielclemente.com/hacer/emacs.html > > ah, that's pretty cool,daniel. any suggestions for how I might > implement this selectively, only for certain headings or heading > levels? My javascript is I think even worse than my elisp... You should start by adding jQuery to your page. Then take this code fragmen= t: // handle the click event for each header for(var i=3D2;i<=3D7;++i) { $("h"+i).each( function(){ $(this).css({cursor: "pointer"}); $(this).bind('click', function(){ toggleForOrg_whenclicked( $(this).pa= rent().children("div").eq(0) ); }); }); } It searches all h2, h3, h4, h5, h6, h7 elements. You can remove the loop an= d use another jQuery selector which finds the headers you want. They are li= ke CSS selectors. For instance this should work: $("h2.myclass") or $("h2, = h4") For that code to work, you should copy at least these functions from esquem= adorg.js: toggleForOrg_whenclicked, hideForOrg_whenclicked, showForOrg_when= clicked. Then add some CSS and custom behaviours. -- Daniel >=20 > Thanks everyone for the suggestions, I am keeping them filed away for > when I actually finish this project... > Matt