From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Barton Subject: Re: Html Export and Containers Date: Sat, 19 Sep 2009 07:46:42 +0100 Message-ID: <4AB47E52.9000802@manor-farm.org> References: <4AB3908C.7010505@manor-farm.org> <87my4sf8pl.fsf@gmx.de> Reply-To: lists@manor-farm.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MotnV-0000lX-Hq for emacs-orgmode@gnu.org; Sat, 19 Sep 2009 02:51:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MotnQ-0000as-78 for emacs-orgmode@gnu.org; Sat, 19 Sep 2009 02:51:52 -0400 Received: from [199.232.76.173] (port=41357 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MotnQ-0000aZ-0a for emacs-orgmode@gnu.org; Sat, 19 Sep 2009 02:51:48 -0400 Received: from mx20.gnu.org ([199.232.41.8]:65206) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MotnP-0002ui-AX for emacs-orgmode@gnu.org; Sat, 19 Sep 2009 02:51:47 -0400 Received: from [217.146.125.41] (helo=firewall.banter.local) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MotnO-00052m-4V for emacs-orgmode@gnu.org; Sat, 19 Sep 2009 02:51:46 -0400 Received: from localhost (localhost [127.0.0.1]) by firewall.banter.local (Postfix) with ESMTP id 58072C5D2 for ; Sat, 19 Sep 2009 07:46:43 +0100 (BST) Received: from firewall.banter.local ([127.0.0.1]) by localhost (firewall.banter.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tpepLZrf-FrH for ; Sat, 19 Sep 2009 07:46:43 +0100 (BST) Received: from [192.168.0.55] (unknown [192.168.0.55]) by firewall.banter.local (Postfix) with ESMTPSA id 0D616C078 for ; Sat, 19 Sep 2009 07:46:43 +0100 (BST) In-Reply-To: <87my4sf8pl.fsf@gmx.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Cc: emacs-orgmode@gnu.org >> >>> As part of my "Using org on Mobile Devices" worglet, I want to try and explain >>> how to use style sheets to present different formatting depending on a mobile >>> device. >>> >>> However, I can't find any documentation about org's default export format, in >>> terms of how the html is contained in divs, etc. There was a disussion a >>> while back at http://www.mail-archive.com/emacs-orgmode@gnu.org/msg11661.html >>> , but I can find anything in the org manual. >>> >>> If the documentation doesn't exist and someone can point me at the relevant >>> bit of lisp code where it's defined, I promise to submit a patch documenting >>> it:) >> Hi Ian, >> >> the lisp code is in org-html.el, but it may be hard to find the relevant pieces. >> >> Maybe the easiest is to make a file with all elements you care >> about, export it and look at the resulting html..... > > > Yes, it's quite self-explanatory. > > > After removing all text content, you'll stay with the bare XHTML and > everything should be obvious. > > > This is the skeleton of a basic file without the information not needed > like styles, JavaScript. I indented the text for readability. But note, > that the contents of such a file vary a lot, depending on the export > options and the files contents: > > > > ------------------------------------------------------------------------ > > > example-org-export > > > Table of Contents > > * 1 One <#sec-1> > * 2 Two <#sec-2> > o 2.1 Example <#sec-2.1> > * 3 A task <#sec-3> > * 4 A done task <#sec-4> > > > 1 One vogonian > > ;; A code comment here. > > > > > 2 Two > > Content of `Two. > > > 2.1 Example > > This was done using begin_quote . > > > 3 TODO A task > > Content of `A task'. > > > 4 DONE A done task > > CLOSED: 2009-09-18 Fr 19:29 > > Content of a done task. > > Author: Arthur Dent > > > Date: 2009-09-18 19:33:45 CEST > > HTML generated by org-mode 6.30trans in emacs 23 > > > ------------------------------------------------------------------------ > > > > > > > What is `stable' between several exports, is the nesting and the names > of the main containers (replace X with depth of the nesting and ID with > the section number): > > * body > * content > * title > * div id="outline-container-ID" class="outline-X" > * h1, h2 ... > * div class="outline-text-ID" id="text-X" > > Some containers might or might not exist. E.g. the > > * div id="postamble" > * div id="table-of-contents" (could be placed virtually anywhere) > * etc. > Thanks. I think I should also provide an example .emacs showing basic customization options. The layout I am hoping to achieve is a single column, with TOC at the top. Whilst not necessarily pretty this should be viewable without horizontal scrolling. I have re-used some php from MythTV's web interface that does a good job of detecting mobile browsers and serves up the page with approprriate style sheet. I am hoping that this will let people build a single site that works on both desktop and mobile devices. Ian.